File: tagpix/examples/AUTOMATED-INPUTS/tagpix-listonly.sh

#!/bin/bash
#====================================================================
# List-only tagpix.py run - show merges but don't perform them.
#
# Edit path settings, and run this with: 'bash tagpix-listonly.sh'.
# Automates console inputs with an in-script bash 'here' document
# (<<-EOF ...tabbed lines... EOF), and omits prompts (2> /dev/null).
#
# The latter works here only because tagpix uses a custom input().
# Python's standard input() prompts to stdout (usually: it's a bug).
# Nit: 2> redirects may also discard error messages; use with care.
#====================================================================

# folder with MERGED/ and New-unmerged/ subfolders
images=~/MY-STUFF/Camera/Digital-cameras-merged

# folder where tagpix.py is installed 
tagpix=~/MY-STUFF/Code/tagpix

cd $images
python3 $tagpix/tagpix.py 2> /dev/null <<-EOF
	y
	New-unmerged
	.
	y
	y
	EOF



[Home page] Books Code Blog Python Author Train Find ©M.Lutz