Alias中的格式字符串(Format String in Alias)
无法获得我使用下面的别名脚本寻求的结果:
alias cfb="ps -eaf | grep PRD_ | egrep startscen.sh | awk '{print $2\"\t\"$14}'"\ _某种格式问题\ - 有人可以帮忙吗?
Unable to get the result I seek using the alias script below:
alias cfb="ps -eaf | grep PRD_ | egrep startscen.sh | awk '{print $2\"\t\"$14}'"some sort of a format issue with \ - Can anyone help?
最满意答案
你可以尝试这样的事情:
alias cfb=$(echo -e "ps -eaf | grep PRD_ | egrep startscen.sh | awk '{print \$2\"\t\"\$14}'")
没有你说1)你寻求的结果是什么,2)提供可测试的可重复的例子,测试它有点困难。
You can try something like this:
alias cfb=$(echo -e "ps -eaf | grep PRD_ | egrep startscen.sh | awk '{print \$2\"\t\"\$14}'")
It's a bit difficult to test it without you saying 1) what is the result you seek, 2) providing a testable reproducible example.
更多推荐
发布评论