Regarding UNIX Shell Script
Posted
by arav
on Stack Overflow
See other posts from Stack Overflow
or by arav
Published on 2010-03-29T23:51:43Z
Indexed on
2010/03/29
23:53 UTC
Read the original article
Hit count: 534
When there is no files inside the folder the below script goes inside the for loop. Not sure what i can modify so that it doesn't go inside the for loop. Also when there is no files inside the directory exit status should be success. Wrapper script checks the exit status of the below script
FILESRAW ="/exp/test1/folder" .
for fspec in "$FILESRAW"/* ; do
echo "$fspec"
if [[ -f ${fspec} ]] ; then
..... processing logic
else
... processing logic
fi
done
© Stack Overflow or respective owner