这里有一个文件的内容:如何在别名中的awk命令中转义字段变量?
one two three
four five six
这里是我的别名
alias testawk "awk '{print $2}' file"
这就是我得到:
> testawk
one two three
four five six
但是,当我给这个命令,我得到我想要的:
> awk '{print $2}' file
two
five
如何转义别名中的字段说明符?注意:我正在使用csh
您试过\ $吗? – 2010-06-24 13:59:25
这里是关于处理csh meta-chars的一个解释http://www.grymoire.com/Unix/Csh.html#uh-7 – 2010-06-24 14:04:14
'\ $'在bash中有效,但是csh有点挑剔。 – 2010-06-24 14:15:29