Skip to content

Instantly share code, notes, and snippets.

@ae-s
Last active February 11, 2023 01:55
Show Gist options
  • Save ae-s/11408492 to your computer and use it in GitHub Desktop.
Save ae-s/11408492 to your computer and use it in GitHub Desktop.
Receipt ingestion machine
#!/bin/bash
display -sample 600 $1 2>&1 >/dev/null &
viewer_pid=$!
sleep 0.5
echo '===='
echo 'What is the date shown? YYYY-MM-DD'
read -p 'date> ' -e -i "$date" date
echo $date
if [ X"$date" = "X" ] ; then
kill $viewer_pid
exit
fi
echo '===='
echo 'What is the time shown? HH:MM:SS'
read -p 'time> ' -e -i "$time" time
echo $time
shasum=$( sha1sum $1 | cut -d\ -f1 )
kill $viewer_pid
git mv $1 ingested/"$date"-"$time"-"$shasum".jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment