Hi All,

At the moment I am using the system() fuctions to run external commands as
follows:

print "Run \"userdel -r $arg\" [y/N] ";
chop ($answer=<STDIN>);
if ($answer =~ /^y/i) {
        print "Deleting account....";
        system("userdel -r $arg");
        print "....Done\n";
}

However, if  "system("userdel -r $arg");" prints any errors, nothing appears
on screen! For example, I am runng this script as a normal user (not root),
which should print the following error.

andrewt@sat:~$ userdel -r $arg
bash: userdel: command not found


But when run from the script nothing happens.

How can I capture the output? Or at least have the output print to screen.

Andrew Tait
System Administrator
Country NetLink Pty, Ltd
E-Mail: [EMAIL PROTECTED]
WWW: http://www.cnl.com.au
30 Bank St Cobram, VIC 3644, Australia
Ph: +61 (03) 58 711 000
Fax: +61 (03) 58 711 874

"It's the smell! If there is such a thing." Agent Smith - The Matrix


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to