RE: bash cli

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





-----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


<<winmail.dat>>


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux