Last active
February 11, 2023 01:55
-
-
Save ae-s/11408492 to your computer and use it in GitHub Desktop.
Receipt ingestion machine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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