chx: fix bug with absolute paths

This commit is contained in:
PowerUser64 2024-05-31 01:04:22 -07:00
parent 9eb49d029e
commit d610a533b0

View file

@ -3,11 +3,11 @@
# toggles whether a file or group of files is executable # toggles whether a file or group of files is executable
for FILE; do for FILE; do
if [ -x "./$FILE" ]; then if [ -x "$FILE" ]; then
chmod -x "./$FILE" && chmod -x "$FILE" &&
echo -e "$FILE: -x" echo -e "$FILE: -x"
elif ! [ -x "./$FILE" ]; then elif ! [ -x "$FILE" ]; then
chmod +x "./$FILE" && chmod +x "$FILE" &&
echo -e "$FILE: +x" echo -e "$FILE: +x"
fi fi
done done