X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <1f97de60810141159u193de792pe496d7a044265738@mail.gmail.com>
Date: Tue, 14 Oct 2008 11:59:07 -0700
From: "Z W" <mpc8250@gmail.com>
To: cygwin@cygwin.com
Subject: cygwin shell scripting - how to pass values from command line to ssh remote command
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.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

Hi
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 '

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 ?

Any help is appreciated.

Thanks

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

