From 43d61f4b7879fefe1511b4d576255cef4b22bb0b Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 6 Oct 2018 18:08:37 +0200 Subject: [PATCH] emit current file to STDERR which isn't buffered --- dla-import-to-sql.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dla-import-to-sql.sh b/dla-import-to-sql.sh index 20601e3..f18257f 100755 --- a/dla-import-to-sql.sh +++ b/dla-import-to-sql.sh @@ -3,7 +3,7 @@ #ls /mnt/share/DLA/inventura/*/*/upload/inv/*.pdX | while read path ; do find /mnt/share/DLA/inventura/ . -name '*.pdX' | grep upload/inv | while read path ; do - echo "# $path" + echo "# $path" >&2 source_id=$(echo $path | cut -d/ -f6) date_scanned=$(echo $path | cut -d/ -f7) strings $path | grep '130[0-9][0-9][0-9][0-9][0-9][0-9][0-9]' | sed -e 's/^.*\(130[0-9][0-9][0-9][0-9][0-9][0-9][0-9]\).*$/\1/' -e "s/^/insert ignore into ffzg_inventura (date_scanned,source_id,barcode) values ('$date_scanned','$source_id','/" -e "s/$/');/" -- 2.20.1