chx: fix bug with absolute paths
This commit is contained in:
parent
9eb49d029e
commit
d610a533b0
1 changed files with 4 additions and 4 deletions
|
@ -3,11 +3,11 @@
|
|||
# toggles whether a file or group of files is executable
|
||||
|
||||
for FILE; do
|
||||
if [ -x "./$FILE" ]; then
|
||||
chmod -x "./$FILE" &&
|
||||
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"
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Reference in a new issue