![]() |
|
|
|
|
|||||||
| 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 |
| Script to add a single line to middle of text file. | progkcp | Shell Programming and Scripting | 2 | 05-12-2008 11:44 AM |
| How to insert text in the middle of a file | kartikkumar84@g | UNIX for Dummies Questions & Answers | 6 | 05-10-2008 11:35 AM |
| insert text in the middle of a file | relle | Shell Programming and Scripting | 3 | 03-13-2008 12:37 PM |
| Insert text file at a certain line. | insania | Shell Programming and Scripting | 4 | 07-31-2006 11:46 PM |
| insert text into the middle of a original file | mopimp | Shell Programming and Scripting | 1 | 03-26-2006 07:11 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
How to insert text into first line of the file and middle of the file?
Script 1
Pre-requisites Create a file with x amount of lines in it, the content of your choice. Write a script that takes two arguments. The first being a line of text, the second being your newly created file. The script should take the first argument and insert it into the very top (the first line) of the file named in your second argument. Note! The file must retain the original name Script 2 Take a copy (backup) and amend the above script so that it now inserts the first argument into the middle of the file. |
| Forum Sponsor | ||
|
|
|
#3
|
|||
|
|||
|
How to add string(without sed&awk )to first line of the file and middle of the file?
Script 1
Pre-requisites Create a file with x amount of lines in it, the content of your choice. Write a script that takes two arguments. The first being a line of text, the second being your newly created file. The script should take the first argument and insert it into the very top (the first line) of the file named in your second argument. Note! The file must retain the original name Script 2 Take a copy (backup) and amend the above script so that it now inserts the first argument into the middle of the file. |
|
#4
|
|||
|
|||
|
|
|||
| Google The UNIX and Linux Forums |