Apply script to several archives in several Folders.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Apply script to several archives in several Folders.
# 1  
Old 11-09-2009
Apply script to several archives in several Folders.

Hello. I'm here again.

I have a script in python and bash, and I need execute this script over all files in all folders.
Example:

Folder: CMDB
Subfolders: router1
router2
switch1
switch2

and in this folders exists a file called "startup-config"

and I need apply the script over all the "startup-config" files.

Thanks for all.

Sorry for my englishSmilie
# 2  
Old 11-09-2009
Code:
for i in `find CMDB -type f -name startup-config`
do
  Your_script $i
done

# 3  
Old 11-10-2009
Quote:
Originally Posted by rdcwayx
Code:
for i in `find CMDB -type f -name startup-config`
do
  Your_script $i
done

Thanks rdcwayx Smilie
# 4  
Old 11-10-2009
Another way :
Code:
find CMDB -type f -name startup-config | xargs -L 1 Yourscript

Jean-Pierre.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Two questions about my script : apply to all my csv and recover filename ?

Hello, I allow me to writing here to seek your assistance about my script bash ! I have many csv files that looks like : MO2PPC20,60,1.5,4 MO2PPC20,39,0.3,5 MO2PPC20,105,2.0,4 MO2PPC20,91,2.0,4 MO2PPC20,79,0.4,4 MO2PPC20,62,1.2,3 MO2PPC20,69,0.3,4 MO2PPC20,60,0.6,4... (6 Replies)
Discussion started by: Tim2424
6 Replies

2. Shell Programming and Scripting

Shell script to apply functions to multiple columns dynamically

Hello, I have a requirement to apply hashing algorithm on flat file on one or more columns dynamically based on header sample input file ID|NAME|AGE|GENDER 10|ABC|30|M 20|DEF|20|F say if i want multiple columns based on the header example id,name or id,age or name,gender and hash and... (13 Replies)
Discussion started by: mkathi
13 Replies

3. Shell Programming and Scripting

How can I apply 'date' command to specific columns, in a BASH script?

Hi everyone, I have a situation in which I have multiple (3 at last count) date columns in a CSV file (, delim), which need to be changed from: January 1 2017 (note, no comma after day) to: YYYY-MM-DD So far, I am able to convert a date using: date --date="January 12, 1990" +%Y-%m-%d ... (7 Replies)
Discussion started by: richardsantink
7 Replies

4. UNIX for Dummies Questions & Answers

Searching for folders/parent folders not files.

Hello again, A little while back I got help with creating a command to search all directories and sub directories for files from daystart of day x. I'm wondering if there is a command that I've overlooked that may be able to search for / write folder names to an output file which ideally... (2 Replies)
Discussion started by: Aussiemick
2 Replies

5. Shell Programming and Scripting

Script to pull Archives from Server A to Server B

Hi all, Iam looking out for a script which pulls archive logs from Server A to Server B. At the same time we donot want the archives to be deleted from Server A. Request you to please help me on this. Thanks, Vivek (1 Reply)
Discussion started by: vivi.raghav
1 Replies

6. Shell Programming and Scripting

Script to find/apply Solaris 10 ACL's

This may be a question for a different forum, but as I will need a script I thought I would start here. We recently migrated from Solaris 8 to Solaris 10. The file system in question here is ZFS, meaning the method for listing and applying ACL's has changed dramatically. To make a long story... (3 Replies)
Discussion started by: Shoeless_Mike
3 Replies

7. Solaris

zfs and flash archives

i had a situation where an app i was running just didn't have enough resources on a proliant dl365 (running sol10x86). so i ended up building out a dl385g2. the dl365 had zfs root file system which was managing the whole disk (smart array taking the raid 1+0). anyway, i figured i could migrate the... (2 Replies)
Discussion started by: pupp
2 Replies

8. UNIX for Dummies Questions & Answers

flash archives

HI, are you supposed to run flarcreate in multi user mode? or should you do it in single user? (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

9. UNIX for Advanced & Expert Users

Jumpstart and Flash Archives

Ladies and Gentlemen: I am short on time and need to get up to speed fast on the use of flash archives. I am very familiar with Jumpstart and have used it successfully for the past 5 years. The current project I am working on requires optimization of time and speed when deploying systems which is... (0 Replies)
Discussion started by: rambo15
0 Replies

10. UNIX for Dummies Questions & Answers

tar archives

I have a tar archive which I believe may be corrupted, produced on an HP-UX 10.x box and written to a 4mm DDS-3 tape. I understand that gnu tar has a -W (--verify) option which will attempt to verify the archive after it has been created. Am I right in saying that this option cannot be used to... (4 Replies)
Discussion started by: sam_pointer
4 Replies
Login or Register to Ask a Question