• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't understand about this error script  RSS feed

 
jin Otanashi
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is just part of script to give you a general idea how this work
#nested if else statement to find the hostname for the other db or machine
if[ $hostname = "PC1"]
then
   IP= "12.123.123.123"
  else
    temp=$ ( ) #no special here
echo temp "ip &"  $hostname>>/temp/file

if [ "temp -ge 115 "]
then
echo $temp
temp = "321";
echo $temp
else ((temp++))
echo $temp "is the ip of machine" >>/temp/file

a bunch of script down here #end

here is the problem line eof while looking for matching "
which is
if ...
else
bckpcmd= "--exclude='home' $bckpcmd" tar --zcvf/temp/bckp1-$hostname.tgz . --exclude= ' /bckp'\ blah blah
fi
ssh user@Ip
echo $hostname 

if [ -f bckp-$hostname.tgz ]
then mv bckp- $hostname bckp2
else
scp -r  #the shell copy of bckp1 and bckp2

echo "there is a second bckup"
last error which is syntax error unexpect end of file 

anyone can find why there are such a error in the shell ? everything look find until those error above popup when the shell is running

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!