[ale] THANKS to all who replied to "ls -rt | rm -i" problem, BUT...ATTN:JoeKnapka
Geoffrey
esoteric at 3times25.net
Sun Mar 19 20:02:26 EST 2006
Bj?rn Gustafsson wrote:
> On 3/19/06, Geoffrey <esoteric at 3times25.net> wrote:
>> Bj?rn Gustafsson wrote:
>>> Note that this will still fail if you somehow get tabs or newlines (or
>>> other weird $IFS characters you might have) in your filenames, as the
>>> awk script makes an assumption that only (single) spaces are used as
>>> field separators.
>> This is not correct. The default separator for awk is white space,
>> which includes both spaces and tabs. You can set the field separator
>> with the -F flag to awk and you can actually set it to multiple values
>> as in:
>>
>> awk -F '[:|]'
>
> Um, that depends on what you mean by "not correct". If you create a
> filename that contains a tab, your awk script will fail, as it will
> replace said tab with a single space.
You are correct on the above. My bad.
> Similarly, if you have a
> filename with two or more spaces in a row, it will also fail.
Agreed.
> It will
> also fail (for different reasons) if the filename contains a newline.
> That's really what I was talking about, and it is certainly true.
I realize now you are speaking about my specific script and not awk in
general.
--
Until later, Geoffrey
More information about the Ale
mailing list