I got expected result with `…`, but failed with $(…)
kill $(ps ux | grep S..\.tcl | grep -v grep | awk '{print $2}')
Illegal variable name.
kill `ps ux | grep S..\.tcl | grep -v grep | awk '{print $2}'`
(kill expected processes)
By googling, I found some says they are interchangable, but it is not by this example. So, What's the difference between $(…) and `…` in Bash?
Best Answer
I did a
and found the message in /bin/csh. Looks like you are running csh not bash when you are giving the command. eg: