Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 VSarkiss (Monsignor)
on Nov 17, 2006 at 18:28 UTC ( #584772=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)

As you mentioned, TIMTOWTDI. I think I'd rather stick with doing more with bash since that's what most of the script is in. If you want a one-liner you could always separate the parts with a ; :-). Something like:

if grep -v -q 'the_line' ld.so.conf; then echo 'the_line' >> ld.so.con +f; fi
You probably already thought of this, but I figured I'd document it for posterity's sake.


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)
Select or Download Code
Replies are listed 'Best First'.
Re^2: 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 tphyahoo (Vicar) on Nov 17, 2006 at 18:29 UTC
    actually... no, I hadn't thought of this. yes, it's obvious. after it's been explained. thanks :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2015-07-28 08:41 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 (254 votes), past polls