Prev: Posix fortran and the gnu toolchain
Next: Need help with awk regular expression to process chess games
From: Teemu Likonen on 11 Apr 2010 04:16 * 2010-04-11 00:55 (-0700), Harry wrote: > I tried the easier way, didn't work: > > $ LC_ALL=POSIX echo "Abby" | egrep '^[A-Z]+$' > Abby If you want that variable to be effective with the egrep command you must write it this way: $ echo "Abby" | LC_ALL=POSIX egrep '^[A-Z]+$' But neither of these commands actually print anything in my Debian 5.0 system. Something is configured differently in our systems.
From: Sidney Lambe on 11 Apr 2010 04:17 On comp.unix.shell, Harry <simonsharry(a)gmail.com> wrote: > On Apr 11, 12:08=A0pm, Sidney Lambe <sidneyla...(a)nospam.invalid> wrote: >> $echo Abby | egrep -v '[a-z]+' >> $echo ABBY | egrep -v '[a-z]+' >> ABBY > > Both fail to match on my system. I get an exit code of 1. Then there's something wrong with your system. Which is not surprising considering how ignorant of Linux you are. > Secondly, the above regex would match pure numbers also! As I said, I > was looking to match only (and only) upper-case words. The fix for that is pathetically obvious. Not a word of thanks for the effort. <plonk> I'll bet I've killfiled a score of your aliases already. I have most common first names killfiled. Missed "harry". Thanks. This way I eliminate every stinking troll using the name. Sid
From: Harry on 11 Apr 2010 04:38 On Apr 11, 1:17 pm, Sidney Lambe <sidneyla...(a)nospam.invalid> wrote: > Then there's something wrong with your system. > ... > Which is not surprising considering how ignorant of Linux you are. > The fix for that is pathetically obvious. Never mind, I'll figure out. > Not a word of thanks for the effort. I already said "many thanks *in advance*" once in the original post. I thought, I would do so once again toward the end of the discussion... once the issue is (hopefully) fully resolved... with possibly multiple answers... all tried out and fully grokked. > I'll bet I've killfiled a score of your aliases already. > > I have most common first names killfiled. Missed "harry". > Thanks. This way I eliminate every stinking troll using > the name. ???
From: Huibert Bol on 11 Apr 2010 04:40 Harry wrote: > I tried the easier way, didn't work: > > $ LC_ALL=POSIX echo "Abby" | egrep '^[A-Z]+$' > Abby You need to add that setting to the right command (egrep in this case). $ echo "Abby" | LC_ALL=POSIX egrep '^[A-Z]+$' $ echo "ABBY" | LC_ALL=POSIX egrep '^[A-Z]+$' ABBY The advantage of using character classes is that it will work not just with the ASCII subset, but with any uppercase character. $ echo "CAFÉ" | LC_ALL=POSIX egrep '^[A-Z]+$' $ echo "CAFÉ" | egrep '^[[:upper:]]+$' CAFÉ HTH -- Huibert "Okay... really not something I needed to see." --Raven
From: Harry on 11 Apr 2010 04:53 On Apr 11, 1:40 pm, Huibert Bol <huibert....(a)quicknet.nl> wrote: > You need to add that setting to the right command (egrep in this case). > ... > The advantage of using character classes is that it will work not just > with the ASCII subset, but with any uppercase character. Hey thanks, Huibert, appreciate it!
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Posix fortran and the gnu toolchain Next: Need help with awk regular expression to process chess games |