in reply to Re^5: Shell to Perl conversion
in thread Shell to Perl conversion
The above solution is working, but it is not a good way of doing things. And the second option is using sudo. I am not succeeding sudo option where it password prompt is popping up.`/bin/sh /tmp/rockpingping.sh $nodeName > /tmp/result.txt`;
$flag = system("sudo /bin/sh /tmp/sshping.sh > /tmp/result.txt" ); + ## '>' is the redirect operator and test.sh is the shell script If ($flag == 0 ) { // The success result will be stored at result.txt // need to open this file and then use it } else { // failure case }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Shell to Perl conversion
by Corion (Patriarch) on Aug 31, 2008 at 08:50 UTC | |
by rockmountain (Sexton) on Sep 01, 2008 at 08:25 UTC | |
by Corion (Patriarch) on Sep 02, 2008 at 19:20 UTC |