Topper@cup.portal.com (scott andrew marr) (03/08/89)
Could someone tell me why the following alias doesn't work: alias rm "mv $* /user/myname/dumpster" If I type 'rm specific_file_name' I get: mv: specific_file_name exists Or if I type 'rm *' I get: Usage: mv [-f] f1 ... fn d1 Is this just a fluke for Domain IX (S.R. 9.7)? Thanks! /---------------------------------------------------------\ | Scott Marr | | | | "Birds are weird...." | | topper@cup.portal.com | | \---------------------------------------------------------/
GBOPOLY1@NUSVM.BITNET (fclim) (03/10/89)
In article <15510@cup.portal.com>, Scott Andrew Marr ask
Could someone tell me why the following alias doesn't work:
alias rm "mv $* /user/myname/dumpster"
If I type 'rm specific_file_name' I get:
mv: specific_file_name exists
Or if I type 'rm *' I get:
Usage: mv [-f] f1 ... fn d1
Is this just a fluke for Domain IX (S.R. 9.7)?
The $* metacharacter is only valid in a Csh script. The aliasing
mechanism does not substitite $* with the arguments you supplied.
You should use !* (in case my mailer maps these differently,
these 3 characters are <BACK-SLASH> <BANG> <STAR>). The is
to quote the !.
There is a pd program in comp.sources.unix called unrm.rm that does
what you have in mind.
fclim. :-)
fclim --- gbopoly1 % nusvm.bitnet @ cunyvm.cuny.edu
computer centre
singapore polytechnic
dover road
singapore 0513.
Topper@cup.portal.com (scott andrew marr) (03/11/89)
Thanks to all those who responded to my question. For those who are interested, the proper syntax form my alias is: alias rm 'mv \!* /user/c684955/dumpster' The purpose of this alias is to move files to a 'trash can' instead of actually erasing them. I then have cron come around once a day and erase those files in the trash can that are over three days old. The crontab entry to do this is: 45 16 ** 1-5 find /user/c684955/dumpster -mtime +3 -exec /bin/rm {} \; /---------------------------------------------------------\ | Scott Marr | | | | "Birds are weird...." | | topper@cup.portal.com | | \---------------------------------------------------------/