I'm sure a lot of people will be thinking I'm a total bash noob, well I'm still new but learning fast.

I need to find out how to find text in a text file and put a line of text i want AFTER the found line... example.

Let's say I have a file called list.txt and let's say there's a line in it "this is a line" and I want to put in "http://www.google.com/" (without quotes) AFTER "this is a line" (without quotes). How would I do that with bash so I can put it into a script?

I've seen a lot of replacing text within files but I don't want to "replace" the text, i want to "add text after" a particular line.

also while I'm here, is there a simple code to use that will make sure a script is run as root and exit with a sentence if not?

Who is online

Users browsing this forum: No registered users and 4 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum