avatar
A qucik Q about bash alias# Unix - 噫吁兮,危乎高哉
n*t
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!
avatar
l*l
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!

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。