![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| deleting lines from multiple text files | vrms | Shell Programming and Scripting | 3 | 04-25-2008 12:01 PM |
| retrieved multiple lines on multiple places in a file | dala | Shell Programming and Scripting | 8 | 03-14-2008 03:28 PM |
| trying to count lines in multiple files | llsmr777 | UNIX for Dummies Questions & Answers | 1 | 01-23-2008 01:52 PM |
| How can I replace multiple lines from different files | ranga27 | Shell Programming and Scripting | 2 | 02-07-2007 08:57 PM |
| Adding 3 Lines to Multiple c and h files with perl | Lazzar | Shell Programming and Scripting | 2 | 10-28-2003 01:30 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Adding Multiple Lines to Multiple Files
Hello,
I have three lines I need to add to hundreds of files. The files are all in the same format and contain the same information. I want to add the same information to the files. The new lines of information are similar. Here is an example of the three lines: line1: line2 = text1 line3 = text2 They all should be on line 34, 35 and 36. Line 2 and 3 are right justified by 3 spaces. The files all start with the same name separated by a period followed by some random number. name1.number1 If someone can help me create a script, I would be very much appreciative. Thank you, dayinthelife |
|
||||
|
you could put the lines in a file like 'mylittlelines' then for the directory where all these files are
for file in * do cat mylittlelines >> $file done or use find with something like for file in find . -name <pattern> do cat mylittlelines >> $file done |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|