n****t 发帖数: 39 | 1 Hi,
I try set an alias under bash, something like
alias del '/bin/mv \!* /tmp/ '
but under bash, the alias (alias del='/bin/mv $* /tmp/')
always complain that tmp foler cann't be overwritten.
I sewarched nline but in vain. Could anyone give me a pointer?
I would appreciate you may reply to my email account as well.
Thanks! | l*l 发帖数: 225 | 2 It can't be access though alias.
alias give the var at the end of your alias, so
del test1 will be translate to :/bin/mv /tmp/ test1
Obviously you will get wrong message!
Solution is using function:
del() { /bin/mv $* /tmp }
add upper line in your .bashrc
Done
【在 n****t 的大作中提到】 : Hi, : I try set an alias under bash, something like : alias del '/bin/mv \!* /tmp/ ' : but under bash, the alias (alias del='/bin/mv $* /tmp/') : always complain that tmp foler cann't be overwritten. : I sewarched nline but in vain. Could anyone give me a pointer? : I would appreciate you may reply to my email account as well. : Thanks!
|
|