delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/10/14/17:16:44

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <1f97de60810141415v7e577281wb6eda23a177814a4@mail.gmail.com>
Date: Tue, 14 Oct 2008 14:15:28 -0700
From: "Z W" <mpc8250 AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cygwin shell scripting - how to pass values from command line to ssh remote command
In-Reply-To: <gd2ucq$eck$1@ger.gmane.org>
MIME-Version: 1.0
References: <1f97de60810141159u193de792pe496d7a044265738 AT mail DOT gmail DOT com> <gd2ucq$eck$1 AT ger DOT gmane DOT org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi Thorsten

Thanks for the response.
I think you understood my question.

I like to pass parameters from tesh.sh as command line arguments and
then pass them into the ssh remote command string. I'm just not sure
of the syntax so that I could pass the paramter values to the remote
command string from test.sh

On Tue, Oct 14, 2008 at 1:10 PM, Thorsten Kampe
<thorsten AT thorstenkampe DOT de> wrote:
> * 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 AT 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. The multiple
> export statements are superfluous. The "cd" looks superfluous, too. Also
> the "pwd". Also the "exit".
>
>> This script in turn ssh into another cygwin Windows box which contains
>> another shell script start.sh to be invoked.
>>
>> As one can see, the variables MAX_MS, OFFSET_MS, THREADS, RAMP and
>> LOOPS are hardcoded inside this ssh remote command.
>>
>> Question:
>> How can I pass arguments on command line with test.sh such that
>> variables MAX_MS, OFFSET_MS, THREADS, RAMP and LOOPS
>> could receive the argument parameters as opposed to hardcoding the numbers ?
>
> http://tldp.org/LDP/abs/html/internalvariables.html -> Positional
> Parameters
>
> Thorsten
>
>
> --
> 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/
>
>

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019