X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <17393e3e0810141549o5a09cab8y33a2ef20b593f843@mail.gmail.com>
Date: Tue, 14 Oct 2008 18:49:20 -0400
From: "Matt Wozniski" <godlygeek@gmail.com>
To: cygwin@cygwin.com
Subject: Re: cygwin shell scripting - how to pass values from command line to ssh remote command
In-Reply-To: <013601c92e4d$f1a6cdd0$9601a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <1f97de60810141159u193de792pe496d7a044265738@mail.gmail.com> 	 <gd2ucq$eck$1@ger.gmane.org> 	 <013601c92e4d$f1a6cdd0$9601a8c0@CAM.ARTIMI.COM>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Tue, Oct 14, 2008 at 6:41 PM, Dave Korn wrote:
> Thorsten Kampe wrote on 14 October 2008 21:11:
>
>> * Z W (Tue, 14 Oct 2008 11:59:07 -0700)
>>> I'm have a shell script, test.sh below to run with cygwin in a Windows
>>> box.
>>>
>>> #!/usr/bin/sh
>>>
>>> ssh qa@load01 'export MAX_MS=100; export OFFSET_MS=89900; export
>>> THREADS=4; export RAMP=1; export LOOPS=2; echo load01 ; cd
>>> /cygdrive/c/apps/bin ; pwd ; nohup ./start.sh  \& ; ps -efW | grep
>>> java ; exit '
>>
>> That's not a shell script - it's just a single command.
>
>  Uh, it's a shell script *containing* a single ssh command.  Note the
> shebang.  Also note the mention of the filename "test.sh", which is not to be
> confused with the script "start.sh" on the remote machine.

I'm with you here...

>> The multiple export statements are superfluous.
>
>  Surely not, if you want the definitions to be visible in the sub-shell that
> executes "start.sh"?

I think Thorsten meant that a single "export" with multiple var=val
pairs would have sufficed here.

>> The "cd" looks superfluous, too.
>
>  Surely not, unless /cygdrive/c/apps/bin is the qa user's home dir?

Definitely not superfluous, since ./start.sh is in that dir..

>>  Also the "pwd".
>
>  Surely not, if it's a bit of debugging trace that lets ZW know that the
> directory exists and so the cd command succeeded and there must be something
> else wrong if the script doesn't execute?

Yep.

>> Also the "exit".
>
>  Ok, I'm with you there :-)  But I still think one of us needs more coffee...

Yep Yep.

~Matt

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

