On 7/26/23 10:15 AM, Zachary Santer wrote:
Oh, that's weird. I just assumed that sh would be running bash with 'set -o posix'. Evidently, not in MSYS2. 'man sh' takes me to the Bash man page.
Weird. I don't use MSYS2, but that's how it works on Unix/Linux systems.
When I run sh, 'set -o posix' has no effect, but it definitely makes echo not interpret any arguments as options when I'm in bash.
Not quite, at least on Unix/Linux/macOS. `set -o posix' by itself doesn't affect echo's behavior with respect to accepting options or expanding backslash-escapes in the remaining arguments. There's too much existing code to try and bother with that. The `xpg_echo' shell option disables option processing and enables backslash-escape translation, which is the POSIX/XSI required behavior. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/