zsh: almost all functions are scripts now (part 2)
This commit is contained in:
parent
75c3986785
commit
ec0cee28d9
14 changed files with 287 additions and 0 deletions
16
.config/shell/bin/chx
Executable file
16
.config/shell/bin/chx
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# toggles whether a file or group of files is executable
|
||||
|
||||
for FILE in "$@";do
|
||||
if [ -x "$FILE" ];then
|
||||
chmod -x "$FILE" &&
|
||||
echo -e "$FILE: -x"
|
||||
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
Add a link
Reference in a new issue