Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping through all files in a directory 1

Status
Not open for further replies.

Meher1

Programmer
Jun 4, 2003
7
US
Hi, I'm very new to unix shell scripting. Need some help. I have to loop through a few files in a directory.

for i in $files
do
awk -f test.awk $i
done


If my directory is /X how do I assign files to?

files= ?

TIA
 
#!/bin/ksh
# to list ALL files with the '.sh' extention under /tmp

dir='/tmp'

for i in ${dir}/*.sh
do
echo "file-> [${i}]"
done


vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top