[ale] THANKS to all who replied to "ls -rt | rm -i" problem, BUT...ATTN:JoeKnapka
Geoffrey
esoteric at 3times25.net
Sun Mar 19 07:59:32 EST 2006
Paul Cartwright wrote:
> On Sat March 18 2006 3:16 pm, Joe Knapka wrote:
>> "cut" is really a crummy tool for this IMO; there's
>> lots of ways it might screw up if the "ls" output
>> varies, which it does (for example, if the width
>> of a field varies, there might be different numbers
>> of fields per line, since "ls" will insert spaces
>> to make the columns line up). What's needed is really
>> something like Python's or Tcl's "split" function,
>> which considers any contiguous group of whitespace
>> characters to be a field delimiter. I'm not aware
>> of a shell function that does the same thing, but
>> there probably is one.
>
> rather than using a field as the delimiter, if you cut by characters,
> starting at 54, you get all the filenames complete:)
> like this
> ls -l | cut -c54-80
Well, the file name could be longer, so you might want
ls -l |cut -c54-
--
Until later, Geoffrey
More information about the Ale
mailing list