bash cli

Miner, Jonathan W (CSC) (US SSA) jonathan.w.miner at baesystems.com
Wed Aug 22 14:35:23 UTC 2007




-----Original Message-----
>
>As I described earlier, if I had to enter:
>
># pidof mysqld
>


Second, the pidof command  prints all the pids associated with a process
name on a single output line.  If pidof finds the named process, the line
will have one or more space-separated numbers on it.  If it doesn't find
the named process, it will print an empty line.  It does not "return null".
-----------------------------

To add to what Tony said... `pidof` will return an exit code of 1 if no processes exist, and 0 if processes do exist:

# pidof Xorg
2354
# echo $?
0
# pidof mysql

# echo $?
1


-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2749 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20070822/da941253/attachment-0001.bin>


More information about the fedora-list mailing list