[ale] THANKS to all who replied to "ls -rt | rm -i" problem, BUT...ATTN:JoeKnapka

Paul Cartwright paul_tbot at pcartwright.com
Sat Mar 18 15:22:17 EST 2006


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
 
-- 
Paul Cartwright
Registered Linux user # 367800 



More information about the Ale mailing list