command line help 
Author Message
 command line help

Maybe someone can help with this.

I want to pipe a filename to perl such that:

fred/foo        prints
fred/foo,1      doesn't print
foo             prints
foo,1           doesn't print

It's funny, I can get this to work in a perl script itself but
cannot seem to get it to work on the command line.

Thanks in advance.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Dean Hoover



Sun, 15 Mar 1998 03:00:00 GMT  
 command line help

: I want to pipe a filename to perl such that:

: fred/foo      prints
: fred/foo,1    doesn't print
: foo           prints
: foo,1         doesn't print

perl -ne 'print if $_ !~ /,[0-9]+$/;' data

--
  Tad McClellan,      Logistics Specialist (IETMs and SGML guy)

  All I want, is a little more than I'll ever get.



Mon, 16 Mar 1998 03:00:00 GMT  
 command line help

Quote:
>Maybe someone can help with this.

>I want to pipe a filename to perl such that:

>fred/foo    prints
>fred/foo,1  doesn't print
>foo         prints
>foo,1               doesn't print

>It's funny, I can get this to work in a perl script itself but
>cannot seem to get it to work on the command line.

perl -ne 'print unless /,1$/'
--
J"org Wunsch                                              Unix support engineer

                                        [private: http://www.sax.de/~joerg/]


Tue, 17 Mar 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. inputing parameters on command line *HELP* needed

2. Command line help.

3. Command line help

4. Help! with command line arguments

5. HELP: Command line processing

6. Newbie needs help- trying to submit command-line function to perl script via web

7. HELP: Command line processing

8. Interactive program with command line history/vi mode--help needed

9. HELP: How to program command line args

10. help w/command line argument

11. Need help with command line for CGI for NT

12. Help passing argument to the command line

 

 
Powered by phpBB® Forum Software