Re: [PATCH 1/3]: Replace kernel/timeconst.pl with kernel/timeconst.sh

Alejandro Mery
2009-01-04T21:52:08Z

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

Valdis.Kletnieks@vt.edu wrote:
> Close, but no cee-gar. cut does something counter-intuitive with multiple
> blanks:
>
> % echo 'a b' | awk '{print $2}'
> b
> % echo 'a b' | cut -d' ' -f2
>
> % echo 'a b' | sed -r 's/[ ]+/ /g' | cut -d' ' -f2
> b
>
> Unfortunately, 'sed -r' isn't in the opengroup.org list of required options,
> and sed 's/ / /g' doesn't DTRT for 3 or more blanks (as it won't recursively
> apply the change to a *new* double blank formed by the previous change).
echo 'a b' | tr -s ' ' | cut -d' ' -f2
b

that is the light way ;-)

Alejandro Mery

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 5013 bytes --]