> hi, i use the unix command file and so i get something like 
> 
> ./home/test...
> 
> but what i need for my program is:
> 
> d        ./home/test... so i need to replace the . at 
> ./home.... with :
> 
> "d        ." ! how can i do that?


Echo echo :

        my $line = './home/test';
        print $line;
        print "\n";
        $line =~ s/^\./d\t\./;
        print $line;


Or you need to get the output of the file command into an array and simple do
 my @file = qx(file ...);
        or 
                my $file = qx(file ...);
                and parse out file so that you get the parts you want into an array
 for(@file) { s/^\./d\t\./; }


Perhaps  I can assist more if you showed me your file command


> 
> 
> THANKS
> ----- Original Message ----- 
> From: "Dan Muey" <[EMAIL PROTECTED]>
> To: "Math55" <[EMAIL PROTECTED]>; "perl" <[EMAIL PROTECTED]>
> Sent: Wednesday, June 18, 2003 6:33 PM
> Subject: RE: magic open and sed?
> 
> 
> Please reply to the list so everyone can help/learn.
> 
> > hi, i am doing a file and i get something like this:
> 
> Doing a file? Whuu??
> 
> > 
> > ./home/test
> > 
> > but what i need is someting like
> > 
> > d        ./home/test
> > 
> > so i am trying to replace the point with d    .so it fits my 
> > other lines.
> > how could i do that?
> 
> my $line = './home/test';
> print $line;
> print "\n";
> $line =~ s/^\./d\t\./;
> print $line;
> 
> OUTPUTS:
> ./home/test
> d ./home/test 
> 
> Is that what you want? I'm not real clear on how your 
> getting this data, what it is exactly, and what you want.
> 
> HTH
> 
> DMuey
> 
> > 
> > THANKS:)
> > ----- Original Message -----
> > From: "Dan Muey" <[EMAIL PROTECTED]>
> > To: "Math55" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Tuesday, June 17, 2003 11:15 PM
> > Subject: RE: magic open and sed?
> > 
> > 
> > > hi, can i use this:
> > 
> > Could you explain in words what you are trying to do?
> > 
> > It looks to me like all you want to do is execute command
> > line commands which you don't need to open a pipe for.
> > 
> > Try
> >  qx(du -h -a > /tmp/all 2>/dev/null);
> >  qx(find -type d sed| s/^\./d       \./ >> /tmp/all);
> >  qx(sort +1 /tmp/all > /tmp/LIST);
> > 
> > This will execute the comands but not doing anythign with
> > output from them which is what you where doing before by 
> > opening a pipe to them.
> > 
> > You can get their output by doing:
> > 
> >  my $out = qx(....);
> > if($out....
> > 
> > HTH DMuey
> > 
> > >
> > >
> > > open (DU1,"| du -h -a > /tmp/all 2>/dev/null");
> > > open (DU2,"| find -type d sed| s/^\./d       \./ >> /tmp/all");
> > > open (DU3,"| sort +1 /tmp/all > /tmp/LIST");
> > > close(DU1);
> > > close(DU2);
> > > close(DU3);
> > >
> > >
> > > with magic open? i think sed is not supprted? how can i do exactly
> > > this another way? if possible with magic open.
> > >
> > > THANKS :)
> > > .::My homepage::.
> > > http://math55.de.vu
> > >
> > > .::Very good JAVA related site::.
> > > http://www.javaCore.de
> > >
> > 
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> > 
> > 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to