[CentOS] Need help in writing a shell/bash script

夜神 岩男 supergiantpotato at yahoo.co.jp
Fri Dec 30 16:58:50 UTC 2011


On 12/31/2011 01:41 AM, m.roth at 5-cent.us wrote:
> Hey, supergiantpotato (and btw, this list is plain text, not unicode, and
> most of us don't read Japanese...),

Thanks for the info

> This is really complicated and fiddly. Look at the one awk script that was
> posted, which is *far* simpler, and uses awk the way it's intended to be
> used, not as a replacement for cut....

I tried it before writing that.
It starts printing names on newlines after the second name in a group. 
Not so good. It also has variable output when the group names are not 
sorted prior to input. Etc.
Given that, I'd say it is more fragile than what I wrote. But whatev. 
Let the OP decide which one is more useful.

Easy to fix, yes.

And perhaps you don't like awk being used that way. Fine. It can be 
substituted -- but awk is an old habit of mine.

The whole script could have been written in just one or two blazingly 
complex sed commands... but that sucks even more for the OP if he has to 
debug it later...



More information about the CentOS mailing list