File name to process from standard input? 
Author Message
 File name to process from standard input?

Why won't the following work?  It does nothing...

find . -name '*.[jJ][sS][pP]' -print0 | xargs -r -0 perl -ip -e
's!\</?font.*?\>!!ig'

I would think that would work fine or the following would work, but it
does not.

find . -name '*.[jJ][sS][pP]' -print0 | xargs -r -0 perl -ip -e
's!\</?font.*?\>!!ig' -

What am I doing wrong with perl?  The find command works fine.  The
perl command works fine if I tell it what file to process...

Thank you in advance for ANY help.

--
-MM
                                               /"\
(No un-solicited email please.)                \ /     ASCII Ribbon Campaign
See following url,                              X      Against HTML Mail
http://www.*-*-*.com/ ;/ \



Mon, 01 Mar 2004 17:09:47 GMT  
 File name to process from standard input?
Quote:

>Why won't the following work?  It does nothing...

>find . -name '*.[jJ][sS][pP]' -print0 | xargs -r -0 perl -ip -e

                                                          ^^^

-i takes an argument. You gave it a one character (p) argument.

Do you have some *.jspp files around now?

Use "-pi " instead if you want no backups made.

Quote:
>'s!\</?font.*?\>!!ig'

    ^          ^
    ^          ^ useless use of backslashes, angle brackets aren't meta

Quote:
>I would think that would work fine

Attempting to process HTML with regular expressions is doomed to failure.

   <font

is legal HTML that will break your code, since you are reading
line-by-line.

There are a few dozen other gotchas to work out too. "perldoc -q HTML"
shows several more of them.

Quote:
>The
>perl command works fine if I tell it what file to process...

Not the same perl command that you showed us. Maybe you got
the order right that time?

--
    Tad McClellan                          SGML consulting

    Fort Worth, Texas



Mon, 01 Mar 2004 18:48:21 GMT  
 File name to process from standard input?

Quote:


> >Why won't the following work?  It does nothing...

> >find . -name '*.[jJ][sS][pP]' -print0 | xargs -r -0 perl -ip -e
>                                                           ^^^

> -i takes an argument. You gave it a one character (p) argument.

> Do you have some *.jspp files around now?

> Use "-pi " instead if you want no backups made.

> >'s!\</?font.*?\>!!ig'
>     ^          ^
>     ^          ^ useless use of backslashes, angle brackets aren't meta

> >I would think that would work fine

> Attempting to process HTML with regular expressions is doomed to failure.

>    <font

> is legal HTML that will break your code, since you are reading
> line-by-line.

> There are a few dozen other gotchas to work out too. "perldoc -q HTML"
> shows several more of them.

> >The
> >perl command works fine if I tell it what file to process...

> Not the same perl command that you showed us. Maybe you got
> the order right that time?

> --
>     Tad McClellan                          SGML consulting

>     Fort Worth, Texas

Ok.  Thank you.

--
-MM
                                               /"\
(No un-solicited email please.)                \ /     ASCII Ribbon Campaign
See following url,                              X      Against HTML Mail
http://pages.prodigy.net/mmynsted/spamoff.htm  / \



Mon, 01 Mar 2004 20:00:54 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CGI.pm and (offline mode: enter name=value pairs on standard input)

2. CGI.pm and (offline mode: enter name=value pairs on standard input)

3. CGI offline mode: enter name=value pairs on standard input

4. standard input and standard error

5. reopening standard input after ^D

6. Reverse standard input

7. read from standard-input within one command?

8. Hide data read from standard input

9. Use script to send Standard Form Input?

10. Newbie: standard input/ouput

11. Need Help Reading Bounced Unix Mails as Standard Input

12. How to direct standard input

 

 
Powered by phpBB® Forum Software