Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Append to file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-02-04, 19:42
pranav610 pranav610 is offline
Registered User
 
Join Date: Jan 2004
Posts: 25
Append to file

Need to come up with a bash script that will add text to new line in a file.
eg: File "append"
line1
line2
line3

Need to come up with a script that will add line 4 and line 5 after line3 as follows to append file:
line1
line2
line3
line4
line5
Reply With Quote
  #2 (permalink)  
Old 06-02-04, 21:30
saccskiz saccskiz is offline
Registered User
 
Join Date: Feb 2004
Posts: 136
I hope I have understood your question correctly -
If you have a file called append.txt containing

line1
line2
line3

If you need to add line4 and line5 below line3, all that is needed is to append
to this already existing append.txt file
Can be done by giving in the script -

echo "line4" >> append.txt
echo "line5" >> append.txt

Let me know if what I understood was not your question
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On