Computing.Net > Forums > Unix > Inserting a string at the end of a

Inserting a string at the end of a

Reply to Message Icon

Original Message
Name: lamos
Date: April 30, 2004 at 07:09:16 Pacific
Subject: Inserting a string at the end of a
OS: Solaris 8
CPU/Ram: 1GB
Comment:

Hi folks,

Using sed and/or awk, how would I insert a text string (from a korn script) after a string that's at the end of a file.

I'm having trouble creating a newline and inserting the text string after the line in a shell script.

Thx


Report Offensive Message For Removal


Response Number 1
Name: thepubba
Date: April 30, 2004 at 10:10:14 Pacific
Subject: Inserting a string at the end of a
Reply: (edit)

Why do you have to use sed or awk? You said it needs to be appended to the end of the file. Why not just use:

print "<string value>" >> <filename>


Report Offensive Follow Up For Removal

Response Number 2
Name: lamos
Date: April 30, 2004 at 21:32:46 Pacific
Subject: Inserting a string at the end of a
Reply: (edit)

Jerry,

You're absolutely correct. The print statement is to the point.

Thanx


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Inserting a string at the end of a 

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge