Is it possible to convert a UNIX shell command into PERL? 
Author Message
 Is it possible to convert a UNIX shell command into PERL?

I would like to convert one of the two lines below from UNIX shell into perl
but I was not able to do it.
Please HELP HELP HELP!

     find . -name "*.h" -follow -print | sed -e 's/^/\"/;s/$/\"/' | xargs
wc -l | sed '$\!d' | nawk '{print $1}'

OR

     wc -l "`find \. -name '*.h' -follow -print`" | sed '$\!d' | nawk
'{print $1}'

Thank you so much for all of your help, Dan



Wed, 21 Apr 2004 00:00:55 GMT  
 Is it possible to convert a UNIX shell command into PERL?
Dan Nguyen wrote in comp.lang.perl.misc:

Quote:
> I would like to convert one of the two lines below from UNIX shell into perl
> but I was not able to do it.
> Please HELP HELP HELP!

>      find . -name "*.h" -follow -print | sed -e 's/^/\"/;s/$/\"/' | xargs
> wc -l | sed '$\!d' | nawk '{print $1}'

A good start is to look at the File::Find perl module, and at the
find2perl utility, that converts find(1) commands to perl code (that
uses File::Find).

--
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
But what about a bit of artistic license?
    -- Monty Python, The Penultimate Supper



Wed, 21 Apr 2004 00:17:40 GMT  
 Is it possible to convert a UNIX shell command into PERL?
Thanks, Dan


Quote:
> Dan Nguyen wrote in comp.lang.perl.misc:
> > I would like to convert one of the two lines below from UNIX shell into
perl
> > but I was not able to do it.
> > Please HELP HELP HELP!

> >      find . -name "*.h" -follow -print | sed -e 's/^/\"/;s/$/\"/' |
xargs
> > wc -l | sed '$\!d' | nawk '{print $1}'

> A good start is to look at the File::Find perl module, and at the
> find2perl utility, that converts find(1) commands to perl code (that
> uses File::Find).

> --
> Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
> But what about a bit of artistic license?
>     -- Monty Python, The Penultimate Supper



Wed, 21 Apr 2004 08:16:15 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Is it possible to convert a UNIX shell command into PERL?

2. Is it possible to convert a UNIX shell command into PERL?

3. Convert Unix command in perl program to straight perl

4. Executing UNIX shell commands in PERL

5. Perl to convert DOS commands inside Unix !!!!!!

6. Calling shell scripts or shell commands from Perl

7. HELP: Piping shell command into perl command?

8. I am having a (possible) problem with crypt in perl

9. Performing shell escapes in perl - is this possible?

10. program to convert Bourne shell scripts to perl

11. converting korn shell scripts to perl

12. converting unix perl to nt perl

 

 
Powered by phpBB® Forum Software