Scan directory and sub directories


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Scan directory and sub directories
# 1  
Old 04-14-2009
Question Scan directory and sub directories

I am really stuck on a issue and have not been able to find a solution.
With the code below I need to not only scan the current directory which as you can see below is...
/lcl/sit/apps/Tivoli/

But I also want it to scan all sub directories it finds under Tivoli as well for the same thing which is all files that are *.sh.

Any help would really be great.

Code:
for i in /lcl/sit/apps/Tivoli/*.sh -N
do
/lcl/apps/svn/subversion/bin/svn import $i http://notlisted.com/svn/Omnibus/trunk/sit_obj_server/$i -m "Initial import" 
done

Been trying all day to figure this one out.

Thanks in advance!

Last edited by vgersh99; 04-14-2009 at 10:08 AM..
# 2  
Old 04-14-2009
Code:
#!/bin/ksh

find /lcl/sit/apps/Tivoli -type f -name '*.sh' | while IFS= read i 
do
   /lcl/apps/svn/subversion/bin/svn import $i http://notlisted.com/svn/Omnibus/trunk/sit_obj_server/$i -m "Initial import" 
done

# 3  
Old 04-14-2009
Worked perfectly. Thank you!
For the life of me I could not figure this one out.

Thanks again.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Create automated scan of specific directory using bash

I am trying to use bash to automate the scan of a specific directory using clamav. Having this in place is a network requirement. The below is an attempt to: 1. count the extensions (.txt, .jpeg) in a directory and write them to a virus-scan.log (section in bold) 2. scan each folder in the... (6 Replies)
Discussion started by: cmccabe
6 Replies

2. Shell Programming and Scripting

Scan directories and create a list of files

Gents, Please can you help. I want to create a list which contends the complete patch of the location of some directories with the size of each file. need to select only .txt file In this case I am try to find the subdirectories tp1 and tp2 and create the output list. jd175-1 tp1... (3 Replies)
Discussion started by: jiam912
3 Replies

3. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

4. Homework & Coursework Questions

Creating directories within a directory?

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Ok i need to create a directory within another directory in one command. I'm already in a directory to. I need to... (6 Replies)
Discussion started by: gangsta
6 Replies

5. Shell Programming and Scripting

going through files in a directory, and it's sub-directories

i have a c-shell script. and i pass it one or two arguments the first argument is the directory the second is the "-r" now, if i pass it only one, it searches the files ending in txt in that directory if i pass it two parameters, like "temp" and "-r" i want it to go through all the files and... (1 Reply)
Discussion started by: pantelis
1 Replies

6. Shell Programming and Scripting

A script to scan a directory for XML files,

Hi, I am fairly new to unix/linux scripting (about 1 week) and have written a script to scan a directory for xml files, if found call and oracle procedure passing in the file name and then move the file once processed to an archive area. Now everything seems to be working except when there... (3 Replies)
Discussion started by: apacheuk
3 Replies

7. Solaris

How list all directories in a directory?

Hi How can i list all the directories inside a directory? not only the directories in the present dir. also the directories inside directories present in the dirrectory. recursive. "find . -type d" will work with other Unix flavors but not with SunOS. Please help Robin (1 Reply)
Discussion started by: robinbannis
1 Replies

8. Shell Programming and Scripting

scan directory

The script should _scan a specific directory _If a file name is like one provided, then run the command to send the file via CFT The name should be picked from a list. The current list is : ... (11 Replies)
Discussion started by: fireit
11 Replies

9. Shell Programming and Scripting

how many directories and files are there in a directory

I want to know how many directories and files are there in a directory and if the sub directory have any files i also need that also . I have done this far .... (4 Replies)
Discussion started by: smongam
4 Replies

10. UNIX for Dummies Questions & Answers

How one can list only the name of directories present in the directory by using ls co

How one can list only the name of directories present in the directory by using ls command. (2 Replies)
Discussion started by: amolpatil54321
2 Replies
Login or Register to Ask a Question