emit current file to STDERR which isn't buffered
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 6 Oct 2018 16:08:37 +0000 (18:08 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 6 Oct 2018 16:08:37 +0000 (18:08 +0200)
dla-import-to-sql.sh

index 20601e3..f18257f 100755 (executable)
@@ -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/$/');/"