dotfiles/.config/shell/bin/chx

14 lines
273 B
Bash
Executable file

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