LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-23-2010, 09:05 PM   #1
i_have_a_question
LQ Newbie
 
Registered: Mar 2010
Posts: 6

Rep: Reputation: 0
Unhappy write ssh terminal


Hi, Im writing a code in bash script, in my ubuntu command terminal. The program should send the message, "Hello John!!" 5 times to john's terminal(assuming he is logged on to the server). But I keep getting this error: Syntax error: end of file unexpected (expecting "done")

I have tried everything and searched everywhere to find a solution and nothing has work
Please Help Me!

-----------------------------------------------------------------------

#!/usr/bin/sh

clear

x=1 # this sets up the flag so we can have it send a limited amount

while [ $x -le 5 ]
do
write jdouglas << EFO
>Hello John!!
>EFO
x=$(( $x + 1 ))
done


------------------------------------------------------------------------

THANK YOU!!
 
Old 03-23-2010, 09:57 PM   #2
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora, Arch
Posts: 572

Rep: Reputation: 64
Because >EFO does not end the here document.
Put EFO on a line by itself. (Delete >)
 
  


Reply

Tags
done, loop, ssh, terminal, while, write


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I SSH into a tty terminal? dragos240 Gentoo 1 12-07-2009 05:46 PM
Terminal and SSH problem juanvelez Linux - General 1 04-27-2006 09:08 PM
Viewing another terminal using ssh, etc... is it possible? Nalorin Linux - Software 4 05-10-2005 01:06 PM
what happens if I close ssh terminal ? juanb Linux - General 1 09-17-2004 06:15 PM
SSH Remote Terminal gauge73 Linux - General 2 01-29-2003 11:01 AM


All times are GMT -5. The time now is 07:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration