4 #ls /mnt/share/DLA/inventura/*/*/upload/inv/*.pdX | while read path ; do
5 find /mnt/share/DLA/inventura/ . -name '*.pdX' | grep upload/inv | while read path ; do
7 source_id=$(echo $path | cut -d/ -f6)
8 date_scanned=$(echo $path | cut -d/ -f7)
9 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/$/');/"