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: Errorlevel


In appereance it happens with standard DOS commands too:


C:\windows\system32>dir foo

 Directorio de C:\windows\system32

No se encuentra el archivo

C:\windows\system32>echo %errorlevel%
1

C:\windows\system32>ls foo
ls: cannot access 'foo': No such file or directory

C:\windows\system32>echo %errorlevel%
2

C:\windows\system32>dir foo

 Directorio de C:\windows\system32

No se encuentra el archivo

C:\windows\system32>echo %errorlevel%
1


Gracias | Regards - Saludos | Greetings | Freundliche Grüße | Salutations
-- 
Sergio Pedraja
-- 
twitter: @sergio_pedraja | skype: Sergio Pedraja
-----
No crea todo lo que ve, ni crea que está viéndolo todo
-----
"El estado de una Copia de Seguridad es desconocido
hasta que intentas restaurarla" (- nixCraft)


2016-09-22 20:47 GMT+02:00 Gluszczak, Glenn <Glenn.Gluszczak@dell.com>:
>
> Is this a known defect?  The errorlevel of the ls command is passed to the echo.
>
> $ cmd
> Microsoft Windows [Version 6.3.9600]
> (c) 2013 Microsoft Corporation. All rights reserved.
>
> C:\cygwin64\home\Administrator>del c:\tmp\hello
> del c:\tmp\hello
> Could Not Find c:\tmp\hello
>
> C:\cygwin64\home\Administrator>ls foo
> ls foo
> ls: cannot access 'foo': No such file or directory
>
> C:\cygwin64\home\Administrator>echo hello > c:\tmp\hello
> echo hello > c:\tmp\hello
>
> C:\cygwin64\home\Administrator>echo %errorlevel%
> echo %errorlevel%
> 2
>
> C:\cygwin64\home\Administrator>del c:\tmp\hello
> del c:\tmp\hello
>
> C:\cygwin64\home\Administrator>echo hello > c:\tmp\hello
> echo hello > c:\tmp\hello
>
> C:\cygwin64\home\Administrator>echo %errorlevel%
> echo %errorlevel%
> 0
>
>
> --
> 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
>

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