Quote file names to better tolerate filenames with whitespace.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
This commit is contained in:
Jon Seymour 2017-12-03 15:27:13 +11:00
parent 3787455664
commit 07af747ef5
2 changed files with 5 additions and 5 deletions

View file

@ -40,8 +40,8 @@ if [ $# -ne 1 ]; then
fi
asc_key=${1}
if [ ! -f ${asc_key} ]; then
echo "key file not found: ${asc_key}"
if [ ! -f "${asc_key}" ]; then
echo "key file not found: '${asc_key}'"
exit 1
fi

View file

@ -37,13 +37,13 @@ fi
chunks=()
index=1
for img in "$@"; do
if [ ! -f ${img} ]; then
echo "image file not found: ${img}"
if [ ! -f "${img}" ]; then
echo "image file not found: '${img}'"
exit 1
fi
asc_key="${tmp_file}.${index}"
echo "decoding ${img}"
chunk=$( zbarimg --raw --set disable --set qrcode.enable ${img} 2>/dev/null )
chunk=$( zbarimg --raw --set disable --set qrcode.enable "${img}" 2>/dev/null )
if [ $? -ne 0 ]; then
echo "failed to decode QR image"
exit 2