dotfiles/.config/shell/bin/chx

15 lines
265 B
Text
Raw Normal View History

#!/bin/bash
# toggles whether a file or group of files is executable
for FILE; do
2024-05-31 01:04:22 -07:00
if [ -x "$FILE" ]; then
chmod -x "$FILE" &&
echo -e "$FILE: -x"
2024-05-31 01:04:22 -07:00
elif ! [ -x "$FILE" ]; then
chmod +x "$FILE" &&
echo -e "$FILE: +x"
fi
done