Hi i have write the one scripts and the scripts is error. The scripts purpose select one directory to check the file is there or not. i will give the two format of file to search the mention the path one file is there to select the file one copy the another location.please check the my script give me the correct scripts.
#!/bin/bash
b= /tmp <search the directory or soruce directory>
c=/scripts<destination directory>
pwd
str1=`hostname`.`date "+%d%m%y%k"`* <file format>
str2=Ma.`hostname`.`date "+%d%m%y%k"`*
b=$str1,$str2;
if [ $b == $str1 ];
then
echo "output is equal"
echo `ls -l | grep -i "$str1"`;
echo `cp $str1 /scripts`
else
echo "output is not equal"
echo `ls -l | grep -i "$str2"`;
echo `cp $str1 /scripts`
fi
exit 0
---------- Post updated at 12:40 PM ---------- Previous update was at 10:10 AM ----------
please give me the reply.