![]() |
|
|
|
|
|||||||
| 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 |
| Add new lines with a space in beginning | Aejaz | UNIX for Advanced & Expert Users | 8 | 05-01-2008 09:21 AM |
| Delete lines that contain 3 or more words? | revax | Shell Programming and Scripting | 5 | 12-11-2007 02:33 PM |
| Adding a character in the beginning of every line in a .dat file | Cool Coder | Shell Programming and Scripting | 2 | 12-22-2005 02:47 AM |
| grep - to exclude lines beginning with pattern | frustrated1 | Shell Programming and Scripting | 2 | 08-29-2005 04:18 AM |
| delete lines from file2 beginning w/file1 | michieka | Shell Programming and Scripting | 13 | 06-24-2003 10:42 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Adding words to beginning of lines
I have a file that contains a great number of lines, let's say 183 lines, and I want to add: echo " to the beginning of each line. What is the easiest way to do it?
Tx |
| Forum Sponsor | ||
|
|
|
|||
|
Quote:
Code:
cat filename.txt | perl -ne 'print "echo " . $_' > output.txt |
|
|||
|
Thanks!
This command works: sed 's/.*/echo "&"/' What if I want at the same time to add something to the end of each line. i.e echo "unixtest=test" >> firsttest what would the command be to add the >> firsttest to teh end of each line |