這裏有一個文件的內容:如何在別名中的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