Alias中的格式字符串(Format String in Alias)

编程入门 行业动态 更新时间:2024-10-11 05:23:36
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.

更多推荐

本文发布于:2023-08-04 02:38:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1405425.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   格式   Alias   Format   String

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!