-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC3065
Vidar Holen edited this page Apr 11, 2025
·
1 revision
if [ -k file ]
then
echo "File has sticky bit set"
fi
if [ -n "$(find file -prune -perm /1000)" ]
then
echo "File has sticky bit set"
fi
test -k file
and [ -k file ]
are not defined by POSIX. To ensure compatibility with all target systems, use find
instead.
None. If you are targeting a shell that supports test -k
, specify it in the shebang.
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!