I look around but can't figure it out. I figured out how to execute a perl shell script execution, for example:
$cmd = "nautilus";
system $cmd;
However, I want to execute a shell script from perl that would execute something like this on the command line:
su
$password
nautilus
Thus, it will become root, and then the nautilus browser will open. When I tried this, just by executing each command separately, as shown below, this does not work. I would appreciate any advice on the right way to do this .. thanks
$cmd = "su";
system $cmd;
$cmd = $password;
system $cmd;
$cmd = "nautilus";
system $cmd;
source
share