Hi friend,
i have written script as below to check the file existance. but i got error
path="/k/p1100/users/jewel/Output"
FILENAME=`ls -lrt $path/*HT|tail -1|cut -d "/" -f 8`
if [ -s $path/$FILENAME ] ; then
echo "$FILENAME is available "
chmod 755 $path/$FILENAME
/usr/bin/scp $path/$1 xxx@333:xxx/inbox/
else
echo "FILE IS NOT AVAILABLE"
fi
error:
/k/p1100/users/jewel/Output: not a regular file
---------- Post updated at 01:17 AM ---------- Previous update was at 01:06 AM ----------
Now i got this, its fine
path="/k/p1100/users/jewel/Output"FILENAME=`ls -lrt $path/*HT|tail -1|cut -d "/" -f 8`if [ -s $path/$FILENAME ] ; then echo "$FILENAME is available " chmod 755 $path/$FILENAME /usr/bin/scp $path/$FILENAME xxx@333:xxx/inbox/else echo "FILE IS NOT AVAILABLE"fi