![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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... |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
sed 's/$/hh:mm/g' file1 |
|
#3
|
|||
|
|||
|
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. |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|