On Thu, 2006-07-27 at 22:47 +0800, Sayed, Irfan (Irfan) wrote: > Hi, > > I am executing following code. i need to send the output of > system($cmd); command to the file . how do i do that > > plz help
This question has already been answered twice this morning. Please watch for responses to the posts that you make. That being said, if there are shell meta characters in the command, the system function will just execute a sub-shell "/bin/sh -c". What that means to you is that you can use the redirection operator '>' to send the output to a file. See below. > > Regards > Irfan. > > > > #########/usr/atria/bin/Perl -w > > use strict; > use warnings; > my $CT = "/usr/atria/bin/cleartool"; > my @vob_list = `$CT lsvob -s`; > > my $fname = "/tmp/vob_trigger"; > open FILE,">>",$fname or die $!; > > foreach (@vob_list) > { > print "Following are the triggers applied for $_ VOB\n\n"; > # my $cmd = "$CT lstype -kind trtype -invob $_"; my $cmd = "$CT lstype -kind trtype -invob $_ > ${_}.out"; > system($cmd); > print "***********************************************\n\n"; > } > -- Joshua Colson <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>