X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Thorsten Kampe Subject: RE: cygwin shell scripting - how to pass values from command line to ssh remote command Date: Wed, 15 Oct 2008 11:47:07 +0200 Lines: 58 Message-ID: References: <1f97de60810141159u193de792pe496d7a044265738 AT mail DOT gmail DOT com> <013601c92e4d$f1a6cdd0$9601a8c0 AT CAM DOT ARTIMI DOT COM> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit User-Agent: MicroPlanet-Gravity/2.70.2067 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com * Dave Korn (Tue, 14 Oct 2008 23:41:05 +0100) > 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 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. > > 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. Putting a single command in a shell script is useless - because it's a single command. You can call it a shell script because it has the shebang but I call it as it is: it's just a single command. > > The multiple export statements are superfluous. > > Surely not, if you want the definitions to be visible in the sub-shell > that executes "start.sh"? Something like "export MAX_MS=100 OFFSET_MS=89900 [...]" for instance? > > The "cd" looks superfluous, too. > > Surely not, unless /cygdrive/c/apps/bin is the qa user's home dir? That's what a "path" is for, right? cd /cygdrive/c/apps/bin; ./start.sh is in most cases equivalent to /cygdrive/c/apps/bin/start.sh > > 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? If you do "debugging" by cd'ing into a directory and then pwd'ing, then you need a tank full of coffee... > > Also the "exit". > > Ok, I'm with you there :-) But I still think one of us needs more > coffee... Guess, it's you... 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/