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
for FILE; do
if [ -x "./$FILE" ]; then
chmod -x "./$FILE" &&
if [ -x "$FILE" ]; then
chmod -x "$FILE" &&
echo -e "$FILE: -x"
elif ! [ -x "./$FILE" ]; then
chmod +x "./$FILE" &&
elif ! [ -x "$FILE" ]; then
chmod +x "$FILE" &&
echo -e "$FILE: +x"
fi
done