Ivan Novick wrote:
>
> Hi,
Hello,
> does anyone know syntax to run a command and redirect its output directly to
> a file?
>
> Equivalent to myCommand > myFile in shell
open my $pipe, 'myCommand |' or die "Cannot open pipe from myCommand:
$!";
open my $fh, '>', 'myFile' or die "Cannot open myF
Marcos Rebelo wrote:
>
> What is your real problem?
>
Exactly. Using Perl as an agent to simply run a
program and record its output is misuse. Just
use a shell script.
What are you trying to do?
/R
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTEC
ECTED]'; [EMAIL PROTECTED]
Subject: RE: redirecting the output of a command to a file
Is there no other way some perl syntax to redirect to a file the output of a
command?
-Original Message-
From: [EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ]
Is there no other way some perl syntax to redirect to a file the output of a
command?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 26, 2003 7:14 AM
To: Ivan Novick; [EMAIL PROTECTED]
Subject: RE: redirecting the output of a command to a file
system("myCommand > myFile");
must work
-Original Message-
From: Ivan Novick [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 26, 2003 1:11 PM
To: [EMAIL PROTECTED]
Subject: redirecting the output of a command to a file
Hi,
does anyone know syntax to run a command and
Hi,
does anyone know syntax to run a command and redirect its output directly to
a file?
Equivalent to myCommand > myFile in shell
Thanks,
Ivan
Hello,
There is nothing wrong in your perl program. The problem is that not all
nic servers produce the same output. The line with "created on" exists
for some names only, not all. I tried yahoo.com which had it and
netscape.com which didn't have it. So, you should figure out a better
way to
nners
Subject: output of a command to a file
Hello everyone,
How can I take the output of a command, put into a scalar, and then put it
into a file? Here's a portion of what I have:
open(FP, ">>$outfile");
my $command = `whois $h | grep 'created on'`;
print "$co
the man page for the open() function has a section on doing exactly what
your asking for...
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hello everyone,
How can I take the output of a command, put into a scalar, and then put it
into a file? Here's a portion of what I have:
open(FP, ">>$outfile");
my $command = `whois $h | grep 'created on'`;
print "$command";
print FP "$h $command\n";
The above code doesn't work though. There's
10 matches
Mail list logo