#!/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