variable

Bash EUID — effective user ID

Read-only effective numeric user ID of the shell. Useful for diagnostics, but not a substitute for checking permissions of the actual operation. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): effective identity agrees.

Formal Syntax & Structure

bash syntaxbash
${EUID}

Return Value

integer

Effective user ID.

Working Example

Example Snippetbash
[[ $EUID == "$(id -u)" ]] || exit 1printf 'effective identity agrees\n'
Bash Reference