XP is just a number | |
PerlMonks |
Output of a commandby Niel (Initiate) |
on Jul 30, 2008 at 04:23 UTC ( [id://701015]=perlquestion: print w/replies, xml ) | Need Help?? |
Niel has asked for the wisdom of the Perl Monks concerning the following question:
The output of any our product command (like ebs --version) cannot be stored in a variable/file. (But same works fine if it’s a system command like date, ls etc on linux m/c). Is there way out to store this output into any file/variable? Below is the code in perl and it worked if the $command = ls but doesn’t work if the $command = “ebs --version”. Can you please give some input on this?
Script is as follows… $command = ls; my $test = "/usr/anil/scripts/anil1.txt"; open (STDOUT, "> $test"); $t = system("$command");
Back to
Seekers of Perl Wisdom
|
|