RE: Command echo

2015-11-16 Thread Buchbinder, Barry (NIH/NIAID) [E]
Gluszczak, Glenn sent the following at Monday, November 16, 2015 11:16 AM
>
>When I shell to cmd.exe, the commands I execute are echoed (not sure if
>stdout or stderr). This doesn't happen under native cmd.exe. Is there a
>variable that controls this? I only have CYGWIN=nodosfilewarning
>
>Notice the commands "dir" and "whoami" are emitted to the output.

cmd.exe is in control of its own echoing.  Try starting as cmd /q
cmd /?
...
/Q  Turns echo off
...

As to why cmd behaves differently when started under bash (even in a
non-mintty window) than when started directly or under cmd 

Hope that helps.

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.

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



Command echo

2015-11-16 Thread Gluszczak, Glenn
When I shell to cmd.exe, the commands I execute are echoed (not sure if stdout 
or stderr).
This doesn't happen under native cmd.exe.  Is there a variable that controls 
this?  
I only have CYGWIN=nodosfilewarning

Notice the commands "dir" and "whoami" are emitted to the output.  


$ bash --version
GNU bash, version 4.3.42(4)-release (i686-pc-cygwin)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ cmd
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\cygwin\home\mytest>whoami
whoami
mytest


C:\cygwin\home\mytest>dir
dir
Volume in drive C has no label.
Volume Serial Number is 0EA8-F3D1

Directory of C:\cygwin\home\mytest

11/11/2015  09:31 AM      .
11/11/2015  09:31 AM      ..
11/05/2015  05:55 AM 6,054 .bashrc
11/11/2015  09:45 AM 2,401 .bash_history
11/05/2015  05:55 AM 1,494 .bash_profile






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



Re: Command echo

2015-11-16 Thread Andrew DeFaria

On 11/16/2015 08:40 AM, Buchbinder, Barry (NIH/NIAID) [E] wrote:

Gluszczak, Glenn sent the following at Monday, November 16, 2015 11:16 AM


When I shell to cmd.exe, the commands I execute are echoed (not sure if
stdout or stderr). This doesn't happen under native cmd.exe. Is there a
variable that controls this? I only have CYGWIN=nodosfilewarning

Notice the commands "dir" and "whoami" are emitted to the output.


cmd.exe is in control of its own echoing.  Try starting as cmd /q
cmd /?
...
/Q  Turns echo off
...

As to why cmd behaves differently when started under bash (even in a
non-mintty window) than when started directly or under cmd 

Hope that helps.

- Barry
   Disclaimer: Statements made herein are not made on behalf of NIAID.


Mintty (and ssh, etc.) use pty's. cmd does not understand pty's. So if 
you run say Cygwin's bash from a cmd window and then start cmd you will 
not get the echoing. If, however, you start cmd from a bash shell that 
is in a mintty window then you're using pty's and you'll get echoing. 
Likewise if you run bash in a cmd window, then say ssh to another 
machine, you're now using pty's and you'll see the behavior again.

--
Andrew DeFaria
http://defaria.com


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