Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: quick way to add a line to a file, if it's not already present (automating tweaking of /etc/ld.so.conf for installing Image::Magick)

by mk. (Friar)
on Nov 17, 2006 at 16:48 UTC ( #584753=note: print w/replies, xml ) Need Help??


in reply to quick way to add a line to a file, if it's not already present (automating tweaking of /etc/ld.so.conf for installing Image::Magick)

one liner, as requested (:
(it should add one line to the file in case it's not already there and that's all, right?!)
perl -pi -e '$line = 1 if /pattern/; print "the line\n" if !$line&&eof' /etc/ld.so.conf

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*women.pm
  • Comment on Re: quick way to add a line to a file, if it's not already present (automating tweaking of /etc/ld.so.conf for installing Image::Magick)
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (1)
As of 2022-01-17 04:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (51 votes). Check out past polls.

    Notices?