chx: clean up code style, remove impossible condition

This commit is contained in:
PowerUser64 2024-02-29 19:41:40 -08:00
parent d9d0b60ae9
commit 6684e42b12

View file

@ -2,15 +2,13 @@
# toggles whether a file or group of files is executable
for FILE in "$@";do
if [ -x "$FILE" ];then
chmod -x "$FILE" &&
for FILE; do
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"
else
echo "error: file $FILE does not exist" >&2
fi
done