Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Remove a line from a file using perl one liner

by olus (Curate)
on Mar 19, 2009 at 13:56 UTC ( #751720=note: print w/ replies, xml ) Need Help??


in reply to Remove a line from a file using perl one liner

perl -pi -e 's#Alias.*/icons/.*##s;' one.txt


Comment on Re: Remove a line from a file using perl one liner
Download Code
Re^2: Remove a line from a file using perl one liner
by ikegami (Pope) on Mar 19, 2009 at 14:00 UTC
    Lines in httpd conf files are sometimes indented.
    perl -pi -e's#^\s+Alias.*/icons/.*##s' one.txt

      You're absolutely right. Thanks

      I'll go and write on the white board 'assumptions are evil' :o)

      Thanks All ...It worked well for me.
      Thanks a lot.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://751720]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2015-07-04 11:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (59 votes), past polls