if [ -G file ] then echo "File is owned by your effective group" fi
if [ -n "$(find file -prune -group "$(id -g)")" ] then echo "File is owned by your effective group" fi
test -G is a bash/ksh/dash/ash extension to check whether the file is owned by your effective group.
test -G
To ensure compatibility with other shells, you can use find -group "$(id -g)".
find -group "$(id -g)"
If you expect your shell to support test -G, specify this explicitly in the shebang (or with # shellcheck shell=dash directive).
# shellcheck shell=dash
There was an error while loading. Please reload this page.