Problem getting command output
- From: TonyV <kingskippus@xxxxxxxxx>
- Date: Mon, 29 Oct 2007 12:06:43 -0700
I'm running ActiveState Perl version v5.6.1 built for MSWin32-x86-
multi-thread.
I have a script that is being run from another application (HP
Openview Operations for Windows) under the NT Authority\SYSTEM
account, and when I try to collect the output of a command using
something like this:
my $output = `defrag -a c:`;
It comes back blank. It doesn't matter which command I try to run, it
always comes back blank. I really need the output of the command. If
I redirect it to a file like so:
`defrag -a c: > c:\\test.txt`;
It puts the correct info into the file.
I'm not sure why the output is being suppressed. I checked that STDIN
and STDOUT exists using the if (-t STDIN && -t STDOUT), and they both
seem to be.
Does anyone know if there's something special I need to do when trying
to read the output of system commands when scripts are run from within
an automated service-type application? I'm trying to avoid echoing
the results to a file and reading the file in if possible.
Thanks!
.
- Follow-Ups:
- Re: Problem getting command output
- From: John W. Krahn
- Re: Problem getting command output
- Prev by Date: FAQ 8.27 What's wrong with using backticks in a void context?
- Next by Date: Problem getting command output
- Previous by thread: FAQ 8.27 What's wrong with using backticks in a void context?
- Next by thread: Re: Problem getting command output
- Index(es):
Relevant Pages
|