This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygwin shell scripting - how to pass values from command line to ssh remote command


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]