LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   write ssh terminal (https://www.linuxquestions.org/questions/programming-9/write-ssh-terminal-797424/)

i_have_a_question 03-23-2010 08:05 PM

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!!

KenJackson 03-23-2010 08:57 PM

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


All times are GMT -5. The time now is 01:09 PM.