I want to assign the value of a certain pid in order to kill it in a script
Quote:
echo `ps ux | grep dhcpcd | grep -v grep` | cut -d' ' -f2`
|
gets me the pid number, and only that, all right but then
Quote:
pidno=`echo `ps ux | grep dhcpcd | grep -v grep` | cut -d' ' -f2``
|
returns 'command not found' and
Quote:
pidno="echo `ps ux | grep dhcpcd | grep -v grep` | cut -d' ' -f2`"
|
returns the whole string of the output of the command ps.
How can I put the single number in a variable?
Thanks.