I would like to use this in my perl script:
sudo killall -HUP tor
would this work?:
system echo sudo killall -HUP tor
Also how would I get around having to authenticate when running the script/from within the script?
I would like to use this in my perl script:
sudo killall -HUP tor
would this work?:
system echo sudo killall -HUP tor
Also how would I get around having to authenticate when running the script/from within the script?
You could, although your syntax is wrong. The correct syntax would simply to use sudo with any of Perl execution methods:
system "sudo command";
`sudo command`;
exec "sudo command";
But like the comments above point out, it's probably not what you want to do to solve the problem you're trying to solve.
killfunction (perldoc -f kill,man perlipc). – waltinator Jan 22 '17 at 18:08