diff --git a/.config/shell/bin/chx b/.config/shell/bin/chx index f5223a7..5bfd1d0 100755 --- a/.config/shell/bin/chx +++ b/.config/shell/bin/chx @@ -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