![]() |
|
|
|
|
|||||||
| 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 |
| Adding Multiple Lines to Multiple Files | dayinthelife | Shell Programming and Scripting | 2 | 06-04-2008 08:50 AM |
| command for selecting specific lines from a script | gardasgangadhar | UNIX for Dummies Questions & Answers | 1 | 05-13-2008 02:29 AM |
| deleting specific lines from all files in a directory | vrms | UNIX for Dummies Questions & Answers | 3 | 04-25-2008 08:08 AM |
| Shell Script to read specific lines in a file | varshanswamy | Shell Programming and Scripting | 5 | 08-22-2005 04:12 PM |
| Shell Script for searching files with date as filter | kanakaraj_s | Shell Programming and Scripting | 3 | 05-14-2002 08:15 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
need help--script to filter specific lines from multiple txt files
Hi folks,
- I have 800 txt files - those files are cisco router configs Code:
router1.txt router2.txt ... router800.txt - I want to have a seperate file with all the filenames that I want to process - I want a script that goes trough all those filenames and pick out the "access-list" lines - I want that this output is written to a separate file I allready figured out how to get the ""access-list" lines out of 1 txt document: Code:
#grep access-list /router/router1.txt Thanks, |
| Forum Sponsor | ||
|
|
|
|||
|
how do I achieve that between each file I put in something like this:
============================================== router1.txt ============================================== access-list 1 ................ access-list 2 ................ ============================================== router2.txt ============================================== access-list 1 ................ access-list 2 ................ |
|
|||
|
Code:
while read file
do
echo "=============================================="
echo "$file"
echo "=============================================="
grep "access-list" $file >> tgt_file
echo
echo
done < file_lst
|