[ale] When a script is necessary, and when a piped command is sufficient ?

Paul Cartwright paul_tbot at pcartwright.com
Wed Mar 15 09:47:05 EST 2006


On Wed March 15 2006 9:44 am, Courtney Thomas wrote:
> ????????1-find or ls
> ????????2-sort [by file date]
> ????????3-rm [interactively]
>
> I'd prefer a prompted command sequence rather than a script.
>
> For example...
>
> ????????ls -l | sort +5
>
> will print out the dir sorted by file date but I then need to rm
> certain files of a certain date, that HAS been sorted out by the
> above, the sort for putting all the files I want to remove in a
> contiguous sequence so that I can page through the others to that
> point quickly and interactively, to make sure I don't delete
> anything unintentionally.
>
> I've briefly and unsuccessfully attempted to pipe this into some
> sort of "rm" operation from the command line, but failed.
you know you are going to get 75 different ways to do this...
you can redirect the find results to a file OR pipe it to a cut command 
to get just the filenames and maybe even a "for i in 'cat_that_file" 
do rm $i done...
but I'm sure Geoffrey will have a more elegant method:)

-- 
Paul Cartwright
Registered Linux user # 367800 



More information about the Ale mailing list