I've been looking around but can't figure this out.. I figured out how to do a perl execution of a shell script, such as:
#!/usr/bin/perl
$cmd = "nautilus";
system $cmd;
However, I want to do a shell script execution from perl that would do something like this on the command line:
su
$password
nautilus
So it would become root, then open the nautilus browser.. when I tried this by just doing each command on separately, like below, it doesn't work.. I would appreciate any advice as to the proper way to accomplish this.. thanks
$cmd = "su";
system $cmd;
$cmd = $password;
system $cmd;
$cmd = "nautilus";
system $cmd;