I need to get the PID of a process which i ran in background into a variable
echo $! gives me the PID of last background process but how to get this into a variable so that i can use "wait" command later in the script to make sure that this background process was done
var = `echo $!`
echo $var
this is not working
could some body please help
thanks in advance
firestar
Hmmm, maybe it's because I tried that on the command line so I got something like "bash: !`: event not found". But it seems that it's working as a part of a script.