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
|
||||
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue