由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - A qucik Q about bash alias
相关主题
我的alia放在script里为什么不工作?what is wrong with my alias?
够执着的 --- Re: 我的alia放在script里为什么不工作?how to remove a whole directory?
[转载] 卧春简单问题一个
How to find a file in the deep children directory?问一个列目录的问题
tc shell script??how to let a command set in .cshrc run?
HELP!! (CXTERM)[转载] 如何返回当前窗口正在运行的程序名称
how to use chinese font under solaris? help!如何在console 上启动emacs?
[转载] apache conf help!!!Re: small but nice thing to know
相关话题的讨论汇总
话题: alias话题: tmp话题: bash话题: del话题: bin
进入Unix版参与讨论
1 (共1页)
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!

1 (共1页)
进入Unix版参与讨论
相关主题
Re: small but nice thing to knowtc shell script??
Re: 怎么在bash script里面改变xterm窗口的标题?HELP!! (CXTERM)
Re: Bash一问:怎么include how to use chinese font under solaris? help!
[转载] About the history[转载] apache conf help!!!
我的alia放在script里为什么不工作?what is wrong with my alias?
够执着的 --- Re: 我的alia放在script里为什么不工作?how to remove a whole directory?
[转载] 卧春简单问题一个
How to find a file in the deep children directory?问一个列目录的问题
相关话题的讨论汇总
话题: alias话题: tmp话题: bash话题: del话题: bin