Quantcast
Channel: What does "`_`, `-`, `--` or the empty string is used for the shell's error messages" mean? - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 3

Answer by Stephen Kitt for What does "`_`, `-`, `--` or the empty string is used for the shell's error messages" mean?

$
0
0

The subject of “is used for the shell’s error messages” is “$0”, not “_, -, -- or the empty string”. The value given to $0 is used for error messages; so you shouldn’t specify a meaningless value for $0, otherwise you’ll end up with weird error messages. It might make more sense as

Note that the second sh above goes into the inline script's $0. You should use something relevant there (like sh or find-sh), not things like _, -, -- or the empty string, as the value in $0 is used for the shell's error messages:

inline-sh does work in the example: it’s used in the error message, which is the whole point of the example.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>