• 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"]
   IP= ""
    temp=$ ( ) #no special here
echo temp "ip &"  $hostname>>/temp/file

if [ "temp -ge 115 "]
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 ...
bckpcmd= "--exclude='home' $bckpcmd" tar --zcvf/temp/bckp1-$hostname.tgz . --exclude= ' /bckp'\ blah blah
ssh user@Ip
echo $hostname 

if [ -f bckp-$hostname.tgz ]
then mv bckp- $hostname bckp2
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!