chx: clean up code style, remove impossible condition
This commit is contained in:
parent
d9d0b60ae9
commit
6684e42b12
1 changed files with 5 additions and 7 deletions
|
@ -2,15 +2,13 @@
|
||||||
|
|
||||||
# toggles whether a file or group of files is executable
|
# toggles whether a file or group of files is executable
|
||||||
|
|
||||||
for FILE in "$@";do
|
for FILE; do
|
||||||
if [ -x "$FILE" ];then
|
if [ -x "./$FILE" ]; then
|
||||||
chmod -x "$FILE" &&
|
chmod -x "./$FILE" &&
|
||||||
echo -e "$FILE: -x"
|
echo -e "$FILE: -x"
|
||||||
elif ! [ -x "$FILE" ];then
|
elif ! [ -x "./$FILE" ]; then
|
||||||
chmod +x "$FILE" &&
|
chmod +x "./$FILE" &&
|
||||||
echo -e "$FILE: +x"
|
echo -e "$FILE: +x"
|
||||||
else
|
|
||||||
echo "error: file $FILE does not exist" >&2
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue