bin: adjust rd

This commit is contained in:
xeruf 2021-12-12 11:35:36 +01:00
parent 797e1fd2d8
commit 10536a6b1b
2 changed files with 2 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
{ {
echo "$# Args: $@" echo "$# Args: ${@:-DEFAULT}"
#echo "Starred: $*" #echo "Starred: $*"
#echo "${@:-default}" | sed 's/\w\+/\0-w/g' #echo "${@:-default}" | sed 's/\w\+/\0-w/g'
for last; do true; done for last; do true; done

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# Remove recursively safely # Remove recursively safely
case "$1" in ([0-9]) depth=$1; shift;; esac case "$1" in ([0-9]) depth=$1; shift;; esac
for f in "$@" for f in "${@-.}"
do do
test -w "$f" && elevate="" || elevate=sudo test -w "$f" && elevate="" || elevate=sudo
if test -d "$f"; then if test -d "$f"; then
@ -17,5 +17,4 @@ do
fi fi
else $elevate rm -i "$f" else $elevate rm -i "$f"
fi fi
shift
done done