sussane
1
Hi,
My requirement is i need to touch a sequence of files like
touch a
touch b
touch c
now i need the script in a way that checks if all files are touched or not.
if any file say b is not touched then i should get this notification.
Please suggest as i am new to unix
this might help you to get started:
for file in a b c
do
touch $file
if [ $? -ne 0 ] ; then
echo failed
# Send e-mail notification here
fi
done
sussane
3
Thanks a lot yogesh.
one more thing.
The files i need to touch are having date extension like a.20082512
can i code like
for file in *.20082512
do
a=$file
touch $a
if [ $? -ne 0 ] ;
then
echo failed to touch $a
fi
done
I just wanted to confirm bcoz dont have as sandbox to test it. i need to implement it directly.
please suggest.