Edit2: Solved! Thank you all! 🥰 I was supposed to put quotation marks around the command argument variable/substitute within the script, as in scanimage -d [device] –format=png -p -o “$1”

Edit: turns out it’s not the accented character, but the whitespace character in front of július.png, since the script doesn’t accept julius.png either.

#!/bin/bash  
# name of the script is SCAN.bash  
scanimage -d [device] --format=png -p -o $1  

I have tried ’ ', " " and to escape it with \

./SCAN 'anyu 1988 július.png'  
./SCAN "anyu 1988 július.png"  
./SCAN anyu\ 1988\ július.png  

But it throws argument without option. It works fine if I type it out instead of scripting.

The target language is Hungarian and I have generated the necessary locale.

  • insufferableninja@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    4
    ·
    3 hours ago

    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