TurnKey Linux Virtual Appliance Library

Trivial question about sed command for a TKLPatch

Students are working on TKLPatch bundle for Ampache. We're stuck on what we think should be accomplished with sed: We want to insert a line in usage.txt with "Samba:     \\$ipaddr\media."

I'm using two reference books and not finding a solution that works.

I'm pretty sure we start sed -i - I then need a regular expression to direct it to a line number maybe?

sed -i '3 /Samba:....' \a usage.txt 

Is the closest I can get, and it seems far off. How do I direct it to a blank line? Do I need to escape blank spaces backslashes?

Our original draft had us placing a revised usage.txt in the overlay folder, but I figured a bash manipulation would be the preferred method.

 

Any feedback would be appreciated...

Alon Swartz's picture

Actually, the preferred method is using the overlay

As discussed in the usage tips and tricks, the recommended way to update the configuration console usage text is to use the overlay, as it's simpler than tweaking the file using something like sed, and less error prone.

Thanks for prompt reply.

In that case, it seems we have an Ampache patch ready to be bundled. Students will post a link today.


Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)