summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-12-26 14:11:13 +0100
committerErich Eckner <git@eckner.net>2019-12-26 14:11:13 +0100
commit8d5eea0220ca73aaaf2c5d57a35caba3b37a13c1 (patch)
treeacc36ce86531a4135562c4fe763d3584a54a750d
parent36e83f52ca833a42daa9c7e155d944291c17e0d7 (diff)
downloadcopyPhotos-8d5eea0220ca73aaaf2c5d57a35caba3b37a13c1.tar.xz
copyPhotos: linking repariert
-rwxr-xr-xcopyPhotos30
1 files changed, 20 insertions, 10 deletions
diff --git a/copyPhotos b/copyPhotos
index df07fb0..0f7534c 100755
--- a/copyPhotos
+++ b/copyPhotos
@@ -250,16 +250,26 @@ do
read -p 'Dieses Bild für '"${wen}"' hochladen (j/y/n)? ' was
done
[[ "${ec[0]}" == *"${was}"* ]] && \
- if [[ "${wen}" == *" "* ]]
- then
- scp "${bild}" "${publicHost}/${wen%% *}/"
- ssh "${publicHost%%:*}" " \
- cd '${publicHost#*:}' && \
- ln '${wen%% *}/$(basename "${bild}")' '${wen##* }/' \
- "
- else
- scp "${bild}" "${publicHost}/${wen}/"
- fi
+ wen_roh=$(
+ printf '%s\n' "${wen}" \
+ | tr ', ' '\n' \
+ | grep -vxF und \
+ | grep -vxF ''
+ )
+ wen_1=$(
+ printf '%s\n' "${wen_roh}" \
+ | head -n1
+ )
+ scp "${bild}" "${publicHost}/${wen_1}/"
+ echo ssh "${publicHost%%:*}" ' \
+ cd "'"${publicHost#*:}"'"
+ '"$(
+ printf '%s\n' "${wen_roh}" \
+ | sed '
+ 1d
+ s@.*@ln "'"${wen_1}/${bild##*/}"'" "\0/'"${bild##*/}"'"@
+ '
+ )"
;;
esac
done