Syntax error: unexpected end of file

Hello Experts,
I am getting error while execute script from Linux system...

[root@119 bin]# ./BOD.sh
./BOD: -c: line 7: syntax error: unexpected end of file

Script:-
[root@119 bin]# vim BOD.sh
   1 #!/bin/bash
  2 export DISPLAY=:1
  3 cat /root/version.txt |  while read output
  4 do
  5 gnome-terminal \
  6         --tab -t "SMM" -e " sh -c 'sleep 10s; ./startapp SMM' "\

[root@119 ~]# cat version.txt
cd /home/rajat/Desktop/Symbol_4.1.1.1_0812
Enhance TechnologyFounderAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arnoldCommented:
You are missing the "done" to terminate the while ...; do loop
Line 7 leave blank
line 8 done

Should solve the end of file error.
0
woolmilkporcCommented:
You’re missing the “done” statement. Add a line 8 containing just “done “.
0
serialbandCommented:
You have a backslash at the end of line 6.  The backslash indicates that there will be a continuation on the next line.  That's why there's an error about line 7, if you don't have a line 7.  If that's not what you meant, then you should remove it.

 6         --tab -t "SMM" -e " sh -c 'sleep 10s; ./startapp SMM' "\
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Enhance TechnologyFounderAuthor Commented:
Now following script is ok for execute. After execution this script not execute from mention path...
path :- cd /home/rajat/Desktop/Symbol_4.1.1.1_0812

executing from:- /home/rajat

why it is happning ?


[root@119 bin]# ./BOD.sh

Script:-
[root@119 bin]# vim BOD.sh
  1 #!/bin/bash
  2 export DISPLAY=:1
  3 cat /home/rajat/Desktop/version.txt |  while read output
  4 do
  5 gnome-terminal \
  6         --tab -t "SMM" -e " sh -c 'sleep 10s; ./startapp SMM' "\
  7
  8 done

   
[rajat@119 Desktop]$ cat version.txt
cd /home/rajat/Desktop/Symbol_4.1.1.1_0812
0
arnoldCommented:
You can not declare DISPLAY AS IT HAS A special meaning and will be setup when the incoming connection includes an X11 tunnel and this server supports x11forwarding in sshd_config.
0
serialbandCommented:
If you don't understand how DISPLAY is used, then you shouldn't be changing it yourself.  You should also remove that backslash at the end of line 6, rather than adding a blank line for no good reason.
0
Enhance TechnologyFounderAuthor Commented:
It has been solved from following process:-

[root@119 bin]# cat BOD.sh
#!/bin/bash
export DISPLAY=:1
value=$(</home/rajat/Desktop/version.txt)
cd $value
gnome-terminal \
        --tab -t "SMM" -e " sh -c 'sleep 10s; ./startapp SMM' "\
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Enhance TechnologyFounderAuthor Commented:
Thanks Experts...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.