public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: SPC <spedraja@gmail.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: Errorlevel
Date: Thu, 22 Sep 2016 19:13:00 -0000	[thread overview]
Message-ID: <CACytpF_OJnh6YoG0M8i2ekEXYnTh7cZjF=LL715b1QLG4hVMBg@mail.gmail.com> (raw)
In-Reply-To: <91DCAC3CB99C724EB365BB64677FBE7B0BF747@MX204CL04.corp.emc.com>

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

  reply	other threads:[~2016-09-22 18:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22 18:56 Errorlevel Gluszczak, Glenn
2016-09-22 19:13 ` SPC [this message]
2016-09-22 19:55 ` Errorlevel Gluszczak, Glenn
2016-09-23 12:07   ` Errorlevel Andrey Repin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACytpF_OJnh6YoG0M8i2ekEXYnTh7cZjF=LL715b1QLG4hVMBg@mail.gmail.com' \
    --to=spedraja@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).