From f375d80d17d7ab02e7045d5f2aa2eeff6192f4f6 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 1 Jan 2023 16:30:42 -0300 Subject: Minor copy-annotations-from-kobo enhancements (2) --- copy-annotations-from-kobo | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/copy-annotations-from-kobo b/copy-annotations-from-kobo index 271328f..19c894c 100755 --- a/copy-annotations-from-kobo +++ b/copy-annotations-from-kobo @@ -14,7 +14,8 @@ PATTERN="$1" # https://serverfault.com/questions/36421/stop-ssh-login-from-printing-motd-from-the-client#38160 function silentSsh { local connectionString="$1" - local commands="$2" + shift + local commands="$*" if [ -z "$commands" ]; then commands=`cat` fi @@ -34,6 +35,19 @@ show --search "$PATTERN" | while read item; do extension="$(echo $item | sed -e "s|$basename.||")" sdr="$basename.sdr" + # Check if remote file exists + silentSsh $REMOTE <