You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lawrence Velázquez edited this page May 21, 2023
·
3 revisions
In POSIX sh, VARIABLE is undefined.
(or "In dash, ... is not supported." when using dash)
Problematic code:
#!/bin/shecho"$HOSTNAME$UID$RANDOM"
Correct code:
Either switch to a shell like bash that supports the special variable you're trying to use, or use an external command to get the information you want:
The variable you are attempting to use is a special variable in bash or ksh. To get the same information from dash or POSIX sh, use an external command instead.
For PIPESTATUS, the pipeline can be instrumented to record the exit value of each command: