View Single Post
  #2  
Old March 18th 20, 02:17 PM posted to microsoft.public.windowsxp.general
JJ[_11_]
external usenet poster
 
Posts: 744
Default echo "one foo=bar" gives an unexpected result. Why ?

On Wed, 18 Mar 2020 13:05:49 +0100, R.Wieser wrote:
Hello all.

I was thinking about how some characters are not allowed in filenames, and
tried to see if "=" is one of them.
So, I entered, on a commandline, the following: "one foo=bar".

To my surprise the contents of the file became "one =bar"

Can anybody tell me why that "one =bar" result ? (googeling is a bit hard on
it, with the lack of keywords).

Regards,
Rudy Wieser


Something is wrong with your system.

In my system...

This exact command line:

echo "one foo=bar"

It displays below line without creating any file.

"one foo=bar"

This exact command line:

"one foo=bar"

It displays below line without creating any file.

'"one foo=bar"' is not recognized as an internal or external command,
operable program or batch file.

This exact command line:

one foo=bar

It displays below lines, and creating an empty file named "foo".

'one' is not recognized as an internal or external command,
operable program or batch file.

For the last command line, "foo=bar" file is not created because the "="
character is considered as whitespace if it's not wrapped by double quotes.
Ads