UTF-8 characters in POSIX shell script *comments* - anything against it?
11
votes
3
answers
2342
views
I would like to include a couple of non-ASCII characters in my POSIX shell script **comments**. Note this is in no way a duplicate of e.g. "Which character encodings are supported by posix?" as I care for the comments section only. Therefore I don't care if I can use Unicode for actual coding. I care if all shells which are POSIX-compatible will be able to read my file, or if some fail due to non-ASCII encoding.
So, my editor (VS Code), will save such a file with UTF-8 encoding.
Here are two files identified with the
file
utility (unsure if it cares for BOM):
$ file script1*
script1: POSIX shell script, ASCII text executable
script1.utf: POSIX shell script, Unicode text, UTF-8 text executable
Question is, if POSIX shell scripts must be in ASCII only. Can't find anything relevant on this topic. Thank you.
Asked by Vlastimil Burián
(30515 rep)
Jun 18, 2024, 10:21 PM
Last activity: Jul 3, 2024, 03:30 PM
Last activity: Jul 3, 2024, 03:30 PM