5ce82d1642
Having two sets of aliases is hard to manage, therefore merging bash and zsh aliases prevents duplicate content. Some functions set with those aliases needs to be run with sudo and therefore keeping them as functions does not work. Hence, they have been moved into scripts located in a new dedicated "bin" folder. https://serverfault.com/questions/177699/how-can-i-execute-a-bash-function-with-sudo
22 lines
379 B
Bash
Executable file
22 lines
379 B
Bash
Executable file
#!/bin/sh
|
|
|
|
clean_dir()
|
|
{
|
|
local dir="$1"
|
|
|
|
if [ -d "$dir" ]; then
|
|
find "$dir" -name "*~" -print -delete
|
|
find "$dir" -name ".*~" -print -delete
|
|
find "$dir" -name "#*#" -print -delete
|
|
else
|
|
echo "$dir: not a directory" >&2
|
|
fi
|
|
}
|
|
|
|
if [ $# -ne 0 ]; then
|
|
for dir in "$@"; do
|
|
clean_dir "$dir"
|
|
done
|
|
else
|
|
clean_dir "./"
|
|
fi
|