7 Matching Annotations
- May 2025
-
stackoverflow.com stackoverflow.com
-
#!/usr/bin/env npx ts-node // TypeScript code Whether this always works in macOS is unknown. There could be some magic with node installing a shell command shim (thanks to @DaMaxContext for commenting about this). This doesn't work in Linux because Linux distros treat all the characters after env as the command, instead of considering spaces as delimiting separate arguments. Or it doesn't work in Linux if the node command shim isn't present (not confirmed that's how it works, but in any case, in my testing, it doesn't work in Linux Docker containers). This means that npx ts-node will be treated as a single executable name that has a space in it, which obviously won't work, as that's not an executable.
-
- May 2024
- Mar 2024
-
stackoverflow.com stackoverflow.com
-
If you want to write an awk script, which portable to any awk implementations and versions (gawk/nawk/mawk...) it is really hard, even if with --posix (gawk)
-
-
stackoverflow.com stackoverflow.com
-
nowadays many people work with docker containers. Most default docker images do not have bash and something like [[ $string == *foo* ]] will not work.
-
It's not so much a criticism as the preference of a more universal solution over a more limited one. Please consider that, years later, people (like me) will stop by to look for this answer and may be pleased to find one that's useful in a wider scope than the original question. As they say in the Open Source world: "choice is good!"
-
- Oct 2020
-
unix.stackexchange.com unix.stackexchange.com
-
readlink is not part of the standard. A portable script could be implemented with only POSIX shell features.
-
-
stackoverflow.com stackoverflow.com
-
the following seems to do it without the bashism
-