
July 7th, 2004, 04:23 AM
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 13
Time spent in forums: 11 m 42 sec
Reputation Power: 0
|
|
|
ssh from shell script
i m trying to write a script which works as follow.
machine A , where my script is
machine B , the machine where i m trying to ssh
while in A, i'm trying to ssh B, and check if file test.c exist.
if exist, error msg will be displayed.
---------------------------------------------
ssh b.example.com
if [ -f /home/test.c ]; then
echo "file existing! " 1>&2
echo "Program terminating!" 1>&2
exit 1
fi
---------------------------------------------
but this alone is not working.
once i ssh, i'm considering entering machine B.
i would like the code below to work background in machine B, while i'm waiting for the result at machine A terminal.
may i know how i should code this?
|