|
|
|
|
|
by chubot
30 days ago
|
|
FWIW Oils has an option to prevent the ambiguity: osh-0.37$ echo "c:\new"
c:\new
osh-0.37$ shopt --set no_parse_backslash
osh-0.37$ echo "c:\new"
echo "c:\new"
^
[ interactive ]:6: Invalid char escape in double quoted string (OILS-ERR-12)
It really should be echo "c:\\new" # with two backslashes
That is an unambiguous program that works in every shell. In a well-written shell program, the only things that should follow a single backslash in a double quoted string are \ " ` $
(Although I found that this option is only on in ysh, not in shopt --set strict:all ... arguably that should be changed)Nine Reasons to Use OSH - https://oils.pub/osh.html |
|