The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages 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 09:31 AM
adding a line to a file andy2000 Shell Programming and Scripting 2 03-26-2007 08:44 AM
adding text to a file between lines bishweshwar Shell Programming and Scripting 7 10-10-2006 01:03 PM
Adding Text To each line of a file cubs0729 Shell Programming and Scripting 4 09-08-2005 04: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 09:42 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-10-2005
cubs0729 cubs0729 is offline
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...
  #2 (permalink)  
Old 11-10-2005
bhargav's Avatar
bhargav bhargav is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2004
Location: USA
Posts: 511
Code:
sed 's/$/hh:mm/g' file1
  #3 (permalink)  
Old 11-10-2005
odashe odashe is offline
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

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




All times are GMT -4. The time now is 11:28 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0