From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12661 invoked by alias); 14 Feb 2014 08:35:13 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 12649 invoked by uid 89); 14 Feb 2014 08:35:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.9 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT,SPF_SOFTFAIL,WEIRD_QUOTING autolearn=no version=3.3.2 X-HELO: smtpback.ht-systems.ru Received: from smtpback.ht-systems.ru (HELO smtpback.ht-systems.ru) (78.110.50.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 14 Feb 2014 08:35:10 +0000 Received: from [91.78.166.180] (helo=darkdragon.lan) by smtp.ht-systems.ru with esmtpa (Exim 4.80.1) (envelope-from ) id 1WEEEi-00038i-EU; Fri, 14 Feb 2014 12:35:04 +0400 Received: from [192.168.1.10] (HELO localhost) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Fri, 14 Feb 2014 08:20:59 -0000 Date: Fri, 14 Feb 2014 08:58:00 -0000 From: Andrey Repin Reply-To: Andrey Repin Message-ID: <165112012.20140214122059@mtu-net.ru> To: Prakash Babu , cygwin@cygwin.com Subject: Re: batch script execution failing with 255 exit code in cygwin 1.7.28 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00341.txt.bz2 Greetings, Prakash Babu! > I use Cygwin to execute batch scripts on remote windows hosts using ssh. > The batch script execution started failing with the latest cygwin > version 1.7.28. > The exit code thrown is 255 and batch script is not able to process > the command line arguments. > When I try to print the command line argument(%1) its printing both > the argument name and value. And how do you invoke the command?... > This was working fine with Cygwin 1.7.27 and looks to be regression in 1.7.28 > eg. Batch script (test.bat) You should REALLY learn the language you are writing your scripts in before reporting errors to third parties. > @echo off > :setArgs > if ""%1""=="""" goto doneSetArgs if "%~1" == "" goto :label References: goto /?, call /? > set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 > echo %1=== > echo %2=== > shift > shift > goto setArgs > :doneSetArgs > Cygwin.1.7.27 the output of the script would be > #./test.bat OS=Win > OS=== > Win=== > Cygwin.1.7.28 the output of the script is > #./test.bat OS=Win > "OS=Win"=== > === > Is this a known issue ? > Where can I download Cygwin 1.7.27 until I find a workaround/fix to > this issue ? Fix is simple - don't use bogus semantics when calling batch scripts. It took me some time to find vague confirmation, that semicolon and equal sign are valid parameter delimiters, but no direct statement or explanation of reason behind this retardedness. -- WBR, Andrey Repin (anrdaemon@yandex.ru) 14.02.2014, <11:17> Sorry for my terrible english... -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple