Mailinglist Archive: opensuse (770 mails)

< Previous Next >
Re: [opensuse] Fwd: [opensuse-factory] ssh command problem
  • From: Andrew Colvin <andrew@xxxxxxxxxxxxx>
  • Date: Sat, 18 Aug 2012 07:08:15 +0100
  • Message-id: <1950741.SCWqRCWRWH@abcj>
On Friday 17 Aug 2012 17:52:52 lynn wrote:

-------- Original Message --------
Subject: [opensuse-factory] ssh command problem
Date: Fri, 17 Aug 2012 17:47:36 +0200
From: lynn <lynn@xxxxxxxxxxxx>
To: opensuse-factory <opensuse-factory@xxxxxxxxxxxx>

Hi

I have a script which has a ssh call in it:

echo Calling the file server
ssh root@hh32 "mkdir /home2/$2/$1 ; chown $uid:20513 /home2/$2/$1 ;
exit"
echo Back on DC
<rest of script>

The ssh call works, but it never returns to the calling script to finish
the rest of the commands.. IOW we never see the words:
Back on DC
It must have exited because the command prompt after the ssh call is
that of the calling box, not the remote box.

How do I exit correctly at end of the ssh call so that the rest of the
calling script is executed?

Hi Lynn

try using batch mode for ssh (ssh -o "BatchMode yes" ...)

I dont think you need the exit

if you dont want any warnings use -q option as well.

you can also try -v -v -v to get as much debugging as you can to see what is
happening

your mkdir probably should be mkdir -p
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
This Thread
References