Okay..now works....
Missed ls -l in my command.
it happens....with me a lot! :)
Thanks everyone for today's help especially My perl instructor Triojan. Thanks.
...-w
use strict;
use diagnostics;
my $count=0;
open OUTFILE, "> /var/tmp/BIG_FILE" or die "Cannot create Big file" ;
open STREAM, "/bin/ls /var/tmp/*SED | awk '{print \$9}'|" or die "Could not do ls" ;
while (my $file=<STREAM>) {
chomp $file;
open (DATA,$file)...
...while reading instruction for opening DATA.
Thanks.
#!/usr/bin/perl -w
use strict;
use diagnostics;
my $count=0;
open STREAM, "/bin/ls /var/tmp/*SED |" or die "Could not do ls" ;
while (<STREAM>) {
chomp;
my $file;
print "Your Input is $file\n";
open (DATA,"$file")...
My output file is empty....why ?
use diagnostics;
use strict;
my $date=`/bin/date `;
chomp($date);
$date =~ s/[\s:]/_/g;
open STREAM, "/nas/bin/nas_fs -list |" or die "Failed to run nas_fs -list";
open OUTFILE, "> /tmp/fs_list_$date" or die "Failed to create log file";
while (<STREAM>) {...
I think the main prob here is interpretation of $file during redirection. I am not sure what will fix this.
I am trying to add/remove quots w/o a clue.
I solve the ambigus redirection prob by adding back slash to $file in redirection statment...now next one is the open function fails and I have no clue why ? may be the no. of char limitation ?
================================
readline() on closed filehandle main::FS_LIST at /tmp/k line 12 (#1)...
Michael,
Thanks.Yep the "." operater did help.
What I am trying to do is replace all the space and ":" from date cmd o/p with "_" so that I can create a file with that ext.
I tried your sed syntex and it did not getnerate the o/p.
I know I am useing two sed , b/c I do not know how to use "|"...
Hi Trojan, Thanks for quick response.!
Not sure what is causeing the prob..Ithink chomp is not the prob..which I was thinking abt...but something is not right...
I get
I will create /tmp/fs_list_Fri_Jun__3_12_41_16_EDT_2005
sh: $file: ambiguous redirect
readline() on closed filehandle...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.