I am trying to kill a process by name which i will pass as a variable to a system command.
Below is what i have:
my $processName=$ARGV[0];
print \"$
You have the different variables $processName and $jobName, so the whole ` ` expression ends up empty. use strict would have pointed that out; it's useful even for three-line scripts. The kill error message is what you get when you run it without any arguments.
Pro tip: pkill exists, you can replace the whole problematic hack with one command.