Skip to content

Avoid warning: SUDO_USER: unbound variable #35

Answered by Vampire
ssbarnea asked this question in Q&A
Discussion options

You must be logged in to vote

I'm moved this to a discussion, as it is more a usage question than a bug or feature.
The default wsl-shell-command value contains the u flag which errors out if you use an undeclared variable.
Those usages are most often a typo like trying to read SUDO_USRE instead of SUDO_USER.
You can either use variable-substitutions that use default values if the variable is not set, for example for variables set outside the script and just read within, or you can disable this behavior by configuring a custom wsl-shell-command without the u flag.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Vampire
Comment options

@Vampire
Comment options

@ssbarnea
Comment options

@Vampire
Comment options

@ssbarnea
Comment options

Answer selected by Vampire
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #34 on June 30, 2022 15:48.