The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell scripting adding text to top of file meadhere UNIX for Dummies Questions & Answers 7 07-05-2007 06:31 AM
adding a line to a file andy2000 Shell Programming and Scripting 2 03-26-2007 05:44 AM
adding text to a file between lines bishweshwar Shell Programming and Scripting 7 10-10-2006 10:03 AM
Adding Text To each line of a file cubs0729 Shell Programming and Scripting 4 09-08-2005 01:40 PM
Changing the column for a row in a text file and adding another row aYankeeFan Shell Programming and Scripting 9 05-02-2005 06:42 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-10-2005
Registered User
 

Join Date: Jul 2005
Posts: 31
adding text to end of each line in a file

I'm needing to add a "hour:min" to the end of each line in a document. The document in this case is only going to be one line.

if this inserts it at the end, what needs to be changed to add something at the end...

/bin/echo "%s/^/$filler/g\nwq!" | ex -s $oFile


Thank you...
Reply With Quote
Forum Sponsor
  #2  
Old 11-10-2005
bhargav's Avatar
Registered User
 

Join Date: Sep 2004
Location: USA
Posts: 511
Code:
sed 's/$/hh:mm/g' file1
Reply With Quote
  #3  
Old 11-10-2005
Registered User
 

Join Date: May 2005
Posts: 31
Try
sed -e 's/$/hour:min/' InFile >OutFile

I have not worked with ex, but it looks like you meant that it was adding in the beginning, not in the end, to add in the end use the same construction "s/$/MyString".
And I do not know what '!' is doing.

Good luck.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:34 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0