[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Problems with echo. (echo period)
From: |
Dave Korn |
Subject: |
RE: Problems with echo. (echo period) |
Date: |
Thu, 19 Apr 2007 15:59:31 +0100 |
On 19 April 2007 15:27, Aaron Shatters wrote:
> For everyone who has 'echo""' working, I have an explaination...
>
> You probably have the echo.exe available in PATH somewhere. Let me show
> you...
>
> #########################################################
> Microsoft Windows 2000 [Version 5.00.2195]
> (C) Copyright 1985-2000 Microsoft Corp.
> P:\>set PATH=
> P:\>echo""
> 'echo""' is not recognized as an internal or external command,
> operable program or batch file.
> P:\>set PATH=C:\cygwin\bin
> P:\>echo""
>
> P:\>
> #########################################################
Hmm, that's interesting; I do have cygwin echo in my PATH, but that doesn't
explain why I get this:
#########################################################
C:\Documents and Settings\dk>set PATH=C:\cygwin\bin
C:\Documents and Settings\dk>echo""
C:\Documents and Settings\dk>echo --help
--help
C:\Documents and Settings\dk>C:\cygwin\bin\echo --help
Usage: /usr/bin/echo [OPTION]... [STRING]...
Echo the STRING(s) to standard output.
-n do not output the trailing newline
-e enable interpretation of backslash escapes
-E disable interpretation of backslash escapes (default)
--help display this help and exit
--version output version information and exit
If -e is in effect, the following sequences are recognized:
\0NNN the character whose ASCII code is NNN (octal)
\\ backslash
\a alert (BEL)
\b backspace
\c suppress trailing newline
\f form feed
\n new line
\r carriage return
\t horizontal tab
\v vertical tab
NOTE: your shell may have its own version of echo, which usually supersedes
the version described here. Please refer to your shell's documentation
for details about the options it supports.
Report bugs to <address@hidden>.
C:\Documents and Settings\dk>
#########################################################
Is it possible that /bin/echo looks at the path it is invoked by and tries
to impersonate the (posix) shell builtin echo if it's invoked without a path?
Hmm, SuSv6 says that echo "Implementations shall not support any options".
Ah: from echo.c/main():
bool allow_options =
(! getenv ("POSIXLY_CORRECT")
|| (! DEFAULT_ECHO_TO_XPG && 1 < argc && STREQ (argv[1], "-n")));
cheers,
DaveK
--
Can't think of a witty .sigline today....
Re: Problems with echo. (echo period), Aaron Shatters, 2007/04/19
Re: Problems with echo. (echo period), Aaron Shatters, 2007/04/19
Re: Problems with echo. (echo period), Aaron Shatters, 2007/04/20
- RE: Problems with echo. (echo period), Dave Korn, 2007/04/20
- Re: Problems with echo. (echo period), Eli Zaretskii, 2007/04/21
- RE: Problems with echo. (echo period), Dave Korn, 2007/04/23
- Re: Problems with echo. (echo period), Christopher Faylor, 2007/04/23
- RE: Problems with echo. (echo period), Dave Korn, 2007/04/23
- RE: Problems with echo. (echo period), Keith Huntington, 2007/04/23
- Re: Problems with echo. (echo period), Greg Chicares, 2007/04/23