Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Pattern matching within ,, and ^^ parser
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ed Morton  
View profile  
 More options Sep 18 2012, 11:36 am
Newsgroups: comp.unix.shell
From: Ed Morton <mortons...@gmail.com>
Date: Tue, 18 Sep 2012 10:36:48 -0500
Local: Tues, Sep 18 2012 11:36 am
Subject: Re: Pattern matching within ,, and ^^ parser
On 9/18/2012 10:15 AM, Thomas 'PointedEars' Lahn wrote:

> Ed Morton wrote:
<snip>
>> Also, the OP specifically posted that the awk script solved his problem
>> (see below) so I think that's a pretty good indication that i did
>> understand it.

> No, it is pretty good indication that the OP thought that, as you were
> resorting to awk immediately, there were no other possibilities,
> particularly none with only the shell.  Which they made clear in their other
> followup (see below).  Are you simply not paying attention, or whom are you
> trying to fool here?

Now who's projecting?

At the end of the day - no-one has posted a solution using just shell builtins.
If you think such a solution is in some way better than the awk one, then please
do post it. The "proof of concept" you posted elsethread doesn't even come close
to solving the problem (particularly the part about capitalizing the first
letter of every word within quotes) but I'm sure you know that very well or
you'd have produced a working solution based on that.

>> Here's exactly what I said in the posts I think you're referring to:

>>      #On 9/11/2012 12:28 PM, Ed Morton wrote:
>>      # Carlo Zanziba <zanzibaNOS...@NOSPAMlibero.it> wrote:
>>      #
>>      #> Hello,
>>      #>
>>      #> Suppose I have such string
>>      #>
>>      #> str="first. second; third. lost? maybe! no"
>>      #> […]

> So they have a string value in a sh-based shell (which, as it turned out, is
> bash).  And they want to transform that string:

> | I'd want to turn every first character, and every non-blank character
> | after dot, question and exclamative marks to capital, so that it turns to
> |
> | First. Second; third. Lost? Maybe! No

> A plain and simple problem.  From which in your solution, out of thin air,
> it emerges a text file containing the string value …

>>      # $ cat file
>>      # first. second; third. "the prince of arabia" lost? maybe! no

THAT'S what you're whining about? That I used a file to contain the input rather
than a here document or a pipe or just passing a string to the awk script??? I
assumed the OP wasn't pulling strings out of thin air or hard-coding them into
his script otherwise it'd be a pretty pointless exercise. If that had been any
kind of issue it's obviously trivial to use some other way of inputting the
string to the awk script.

> … that you can process with awk then, of course:

>>      # $ cat tst.awk
>>      # BEGIN{ FS="" }
>>      # {
>> […]
>> and here's the OPs final response to the thread:

>>      #On 9/13/2012 2:02 AM, Carlo Zanziba wrote:
>>      # Il 12/09/2012 12:21, Ed Morton ha scritto:
>>      #> On 9/12/2012 1:13 AM, Carlo Zanziba wrote:
>>      #>> Thanks everybody. I was afraid my supposition was too far from
>>      #>> what bash could
>>      #>> give me.
>>      #>>
>>      #>> In any case, I appreciated your efforts.
>>      #>
>>      #> You did see that I gave you a working solution, right?
>>      #
>>      # Sure. It works, and fast!
>> […]

> Of course it works in certain situations.  Nobody doubted that.  The problem
> that you still fail to see lies elsewhere: If all you know is a hammer,
> every problem looks like a nail.

Again, please post the better solution.

<further pointless ramblings snipped>

> BTW: Trim your quotes to the relevant minimum next time, please.

Done. Look, if you think a shell-builtin-only solution is appropriate to solve
the OPs problem then just post it so we can compare or stop whining about the
awk solution.

     Ed.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.