1
1
mirror of https://github.com/chubin/cheat.sh.git synced 2025-01-07 13:47:44 +03:00

Changed sticky bit string from 'sS' to 'tT'

This commit is contained in:
Erez 2020-05-31 09:19:40 -04:00 committed by GitHub
parent dc3e3993ba
commit f9d619a515
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ chmod_calc(){
[ ${num:1:1} -eq 1 ] && p_s+='w' || p_s+='-' [ ${num:1:1} -eq 1 ] && p_s+='w' || p_s+='-'
if [[ $sticky == 'X' ]] if [[ $sticky == 'X' ]]
then then
[ ${num:2:1} -eq 1 ] && p_s+='s' || p_s+='S' [ ${num:2:1} -eq 1 ] && p_s+='t' || p_s+='T'
else else
[ ${num:2:1} -eq 1 ] && p_s+='x' || p_s+='-' [ ${num:2:1} -eq 1 ] && p_s+='x' || p_s+='-'
fi fi
@ -42,7 +42,7 @@ chmod_calc(){
fi fi
done done
# If permission string is given calc number # If permission string is given calc number
elif [[ ${#1} -le 9 && $(( ${#1} % 3 )) -eq 0 && $1 =~ ^[r,w,x,s,S,-]+$ ]] elif [[ ${#1} -le 9 && $(( ${#1} % 3 )) -eq 0 && $1 =~ ^[r,t,T,w,x,-]+$ ]]
then then
p_s=$1 p_s=$1
[[ ${p_s,,} =~ 's' ]] && p_n+="1" || p_n+="0" [[ ${p_s,,} =~ 's' ]] && p_n+="1" || p_n+="0"
@ -56,9 +56,9 @@ chmod_calc(){
[[ ${1:$i:1} == 'w' ]] && W+=('X') || W+=(' ') [[ ${1:$i:1} == 'w' ]] && W+=('X') || W+=(' ')
[[ ${1:$((i++)):1} == 'w' ]] && let num++ [[ ${1:$((i++)):1} == 'w' ]] && let num++
num=$(( num << 1 )) num=$(( num << 1 ))
[[ 'xs' =~ ${1:$i:1} ]] && X+=('X') || X+=(' ') [[ 'xt' =~ ${1:$i:1} ]] && X+=('X') || X+=(' ')
[[ 'Ss' =~ ${1:$i:1} ]] && S+=('X') || S+=(' ') [[ 'Tt' =~ ${1:$i:1} ]] && S+=('X') || S+=(' ')
[[ 'xs' =~ ${1:$((i++)):1} ]] && let num++ [[ 'xt' =~ ${1:$((i++)):1} ]] && let num++
p_n+="$num" p_n+="$num"
done done
else else