grep doesn't work as I think -


i want check if parsoid service running. run command:

service --status-all|grep 'parsoid' 

but result is:

 [ ? ]  aliyun-rdate   [ ? ]  console-setup   [ ? ]  dns-clean   [ ? ]  irqbalance   [ ? ]  killprocs   [ ? ]  kmod   [ ? ]  mysql   [ ? ]  networking   [ ? ]  ondemand   [ ? ]  pppd-dns   [ ? ]  rc.local   [ ? ]  sendsigs   [ ? ]  umountfs   [ ? ]  umountnfs.sh   [ ? ]  umountroot 

why? shouldn't grep able speak parsoid screened out of it?

try:

service --status-all 2>&1|grep -o 'parsoid' 

1 stdout , 2 stderr.

> redirection

& specifies follows file descriptor (not filename)

2>&1 redirects stderr stdout , stdout piped grep

note: service --status-all writes stderr.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -