linux下如何将ps -ef|grep "search"查到的结果赋予一个变量result

2025-05-14 06:27:39
推荐回答(1个)
回答1:

result=$( ps -ef | grep "search" )
用$()将命令的输出赋值给变量