From 08fba9969db77a0563960e1c053a424d02d8ca5b Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 8 Jan 2016 16:29:27 +0100 Subject: No need to grep and awk. Just awk --- bin/ftpsync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ftpsync b/bin/ftpsync index 8ecaf37..8f77988 100755 --- a/bin/ftpsync +++ b/bin/ftpsync @@ -213,7 +213,7 @@ tracefile() { echo "Upstream-mirror: ${RSYNC_HOST}" total=0 if [[ -e ${LOGDIR}/rsync-${NAME}.log ]]; then - for bytes in $(egrep 'Total bytes received: ' "${LOGDIR}/rsync-${NAME}.log" | awk -F: '{print $2}'); do + for bytes in $(awk -F': ' '$1 == "Total bytes received" {print $2} ' "${LOGDIR}/rsync-${NAME}.log"); do bytes=${bytes//,} total=$(( total + bytes )) done -- cgit v1.2.3