分页: 1 / 1

求教/bin/ps -ef|grep "$1"|grep grep和/bin/ps -ef|grep grep的区别

发表于 : 2014-06-17 11:44
糊涂的小强
[xxxx@localhost ~]$ /bin/ps -ef|grep grep
xxxx 16166 2433 0 11:03 pts/0 00:00:00 grep grep
[xxxx@localhost ~]$ /bin/ps -ef|grep "$1"|grep grep
xxxx 16199 2433 0 11:14 pts/0 00:00:00 grep
xxxx 16200 2433 0 11:14 pts/0 00:00:00 grep grep
grep "$1"的作用是什么

Re: 求教/bin/ps -ef|grep "$1"|grep grep和/bin/ps -ef|grep grep的

发表于 : 2014-06-17 16:45
sk1418
$1 在双引号里会引起变量expansion, 就是$1 变量啦.
我觉得那行就没用, 除了加个grep 进程.

Re: 求教/bin/ps -ef|grep "$1"|grep grep和/bin/ps -ef|grep grep的

发表于 : 2014-06-18 21:01
糊涂的小强
sk1418 写了:$1 在双引号里会引起变量expansion, 就是$1 变量啦.
我觉得那行就没用, 除了加个grep 进程.
就是不明白怎么过滤出grep grep的哦