sane-rcp: allow a destination

This commit is contained in:
colin 2022-12-14 10:07:02 +00:00
parent e0b1aef127
commit 5ae3bb2f6c

View File

@ -1,3 +1,10 @@
#!/usr/bin/env sh
# copy some remote file(s) to the working directory, with sane defaults
rsync -arv --progress --append-verify "$@" .
# rsync, with sane defaults
# + verbosity
# + default to cwd as destination if none is provided
dest=
if (( $# <= 1 )); then
# rsync to the current directory by default
dest='.'
fi
rsync -arv --progress --append-verify "$@" $dest