used to two spaces

This commit is contained in:
2021-07-16 18:26:58 +02:00
parent e663aef808
commit fcd0ec7646
2 changed files with 46 additions and 30 deletions

View File

@@ -88,18 +88,34 @@ sshl() {
ssh -N -L ${1}:localhost:${2} $3 ssh -N -L ${1}:localhost:${2} $3
} }
toolbox() { #toolbox() {
if [[ $@ =~ (enter) && ! $@ =~ (-r|--release|-d|--distro) ]]; then # if [[ $@ =~ (enter) && ! $@ =~ (-r|--release|-d|--distro) ]]; then
#
# CONTAINER=$(sed -E -e 's/enter|--container|-c|toolbox|\t|\n|\s//g' <<< $@)
#
# if [[ ! -z ${CONTAINER} && ${CONTAINER} =~ "^[a-zA-Z0-9-]{1,15}$" ]]; then
# command toolbox --container ${CONTAINER} run sudo hostname ${CONTAINER}
# command toolbox enter ${CONTAINER}
# else
# command toolbox enter
# fi
# else
# command toolbox $@
# fi
#}
CONTAINER=$(sed -E -e 's/enter|--container|-c|toolbox|\t|\n|\s//g' <<< $@) dupfind() {
if [ $# -lt 1 ]; then
if [[ ! -z ${CONTAINER} && ${CONTAINER} =~ "^[a-zA-Z0-9-]{1,15}$" ]]; then echo "Usage: $0 THREAD_COUNT [directory] ..." > /dev/stderr
command toolbox --container ${CONTAINER} run sudo hostname ${CONTAINER}
command toolbox enter ${CONTAINER}
else
command toolbox enter
fi fi
if ! [[ "$1" =~ ^[0-9]+$ ]]; then
echo "THREAD_COUNT needs to be an integer." > /dev/stderr
else else
command toolbox $@ if [ $# -lt 2 ]; then
find . ! -empty -type f -print0 | xargs -0 -n1 -P${1} md5sum | sort | uniq -w32 -dD
else
find ${@:2:128} ! -empty -type f -print0 | xargs -0 -n1 -P${1} md5sum | sort | uniq -w32 -dD
fi
fi fi
} }