689eb2316186fa522073a7f0291a333ecb0a3b3b

Author
Matthew Dirba <matthew.dirba@arm.com>
Committer
Matthew Dirba <matthew.dirba@arm.com>
Date

Message

add more backslashes to unweildy awk script

Diff

 1diff --git a/duplicity-backup.sh b/duplicity-backup.sh
 2index 4f067ed98ec233a88bef30f536a70e2c4df26b45..064457cc777120742953ad223181e5f7d8ef9efe 100644
 3--- a/duplicity-backup.sh
 4+++ b/duplicity-backup.sh
 5@@ -401,7 +401,7 @@ get_remote_file_size()
 6     "ss")
 7       TMPDEST="${DEST#*://*/}"
 8       TMPDEST="${DEST%/${TMPDEST}}"
 9-      ssh_opt=`echo $STATIC_OPTIONS |awk -vo="--ssh-options=" '{s=index($0,o); if (s) {s=substr($0,s+length(o)); m=substr(s,0,1); for (i=2; i < length(s); i++) { if (substr(s,i,1) == m && substr(s,i-1,1) != "\\") break; } print substr(s,2,i-2)}}'`
10+      ssh_opt=`echo $STATIC_OPTIONS |awk -vo="--ssh-options=" '{s=index($0,o); if (s) {s=substr($0,s+length(o)); m=substr(s,0,1); for (i=2; i < length(s); i++) { if (substr(s,i,1) == m && substr(s,i-1,1) != "\\\\") break; } print substr(s,2,i-2)}}'`
11 
12       SIZE=`${TMPDEST%://*} ${ssh_opt} ${TMPDEST#*//} du -hs ${DEST#${TMPDEST}/} | awk '{print $1}'` 2>> ${LOGFILE}
13       EMAIL_SUBJECT="$EMAIL_SUBJECT $SIZE `${TMPDEST%://*} ${ssh_opt} ${TMPDEST#*//} df -hP ${DEST#${TMPDEST}/} | awk '{tmp=$5 " used"}END{print tmp}'`" 2>> ${LOGFILE}