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: batch script execution failing with 255 exit code in cygwin 1.7.28


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


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