开发者

Why do Windows environment variable names use a special escape character?

开发者 https://www.devze.com 2022-12-27 15:06 出处:网络
I am curious if there is any history behind why the ^ character is used to escape the special characters <, >, |, &, and ^ in environment variable names in Windows instead the \\ character t

I am curious if there is any history behind why the ^ character is used to escape the special characters <, >, |, &, and ^ in environment variable names in Windows instead the \ character that is typically used to escape special characters.

Please note that I realize there may be no reason开发者_如何学Python for this, but I'd be interested to hear if there is a reason.


'\' is the character typically used to escape special characters on Unix systems (or the language C, or any language inspired by C). Which is handy, because it's more or less the only use of that character in those systems / languages.

Windows, on the other hand, comes from a CP/M heritage, which uses '\' as path delimiter. (Edit: Not quite correct, see comment below.) Having to escape the path delimiter on each occurence would be a bit awkward, and I guess (!!) that's why they chose a different escape character.

0

精彩评论

暂无评论...
验证码 换一张
取 消