-g FILE (conditional operator)
true
if the file exists and its set-group-id bit is set, i.e. the SETGID
bit.
false
if the file does not exist or does not have the SETGID
bit set.
-u
is for the set-user-id
bit.
Links
Examples
- Different ways to test if a file has the SETGID bit set:
1 2 3 4
test -g ~/bin/cmd && echo "SETGID set" [ -g ~/bin/cmd ] && echo "SETGID set" # Bash [[ -g ~/bin/cmd ]] && echo "SETGID set"
- Set the
SETGID
bit 1
chmod g+s /usr/local/bin/my-cmd
BashSupport Pro ist eine Bash IDE mit Unterstützung für -g – probieren Sie es aus!