diff --git a/.local/bin/scripts/arg-test b/.local/bin/scripts/arg-test index 08fa481..79977b4 100755 --- a/.local/bin/scripts/arg-test +++ b/.local/bin/scripts/arg-test @@ -1,6 +1,6 @@ #!/bin/sh { -echo "$# Args: $@" +echo "$# Args: ${@:-DEFAULT}" #echo "Starred: $*" #echo "${@:-default}" | sed 's/\w\+/\0-w/g' for last; do true; done diff --git a/.local/bin/scripts/rd b/.local/bin/scripts/rd index 7ae973c..a084ee5 100755 --- a/.local/bin/scripts/rd +++ b/.local/bin/scripts/rd @@ -1,7 +1,7 @@ #!/bin/sh # Remove recursively safely case "$1" in ([0-9]) depth=$1; shift;; esac -for f in "$@" +for f in "${@-.}" do test -w "$f" && elevate="" || elevate=sudo if test -d "$f"; then @@ -17,5 +17,4 @@ do fi else $elevate rm -i "$f" fi - shift done