rsync adapter to make it play nice with dialog --gauge
authorCameron Ball <c.ball1729@gmail.com>
Fri, 5 Jun 2015 15:39:22 +0000 (23:39 +0800)
committerCameron Ball <c.ball1729@gmail.com>
Fri, 5 Jun 2015 15:39:22 +0000 (23:39 +0800)
rsync-adapter.sh [new file with mode: 0755]

diff --git a/rsync-adapter.sh b/rsync-adapter.sh
new file mode 100755 (executable)
index 0000000..2d3e6f8
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+
+rsync --progress "$@" | tee >(grep -i ".sm" > /tmp/newsongs.txt) | mawk -Winteractive '{ if (index($0, "to-check=") > 0) { split($0, pieces, "to-check="); split(pieces[2], term, ")"); split(term[1], division, "/"); print (1-(division[1]/division[2]))*100 } }' \
+                     | sed --unbuffered 's/\([0-9]*\).*/\1/'