Put the $1 in quotes in the script. -o "$1" ?
post
replies:
Shellcheck can help spotting such mistakes: https://www.shellcheck.net/
If there is whitespace in the filename, when you pass it to the script you need to escape it or wrap it in quotes. And then you need to put quotes around the variable in the script that reads the parameters.
From what you posted, you aren't including the space in the filename inside the quotes
ahhh ... found your problem: Put double quotes around the $1 in the bash script: scanimage -d [device] --format=png -p -o "$1"
all 8 comments