Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是一个文件的内容:
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
用 w/ 包装别名'并'\''用于嵌入的'.
'
'\''
alias testawk 'awk '\''{print $2}'\'' file'