10

The shellscript is very simple:

retroarch $* -c /tmp/retroarch/Data/retroarch/gambatte.cfg

("retroarch" is another shellscript)

If the filename passed contains spaces it fails:

RetroArch [ERROR] :: Could not read ROM file.
slm
  • 363,520
  • 117
  • 767
  • 871
eadmaster
  • 1,573
  • 4
  • 18
  • 30

2 Answers2

13

Use quotes.

Instead of

yourcommand some file.name

use

yourcommand "some file.name"

When using variables, quote them as well.

yourcommand "$filename"
yourcommand "$@"
...
frostschutz
  • 47,228
  • 5
  • 112
  • 159
-1

In general you have to either escape the spaces with backslashes () or wrap the path in either single quotes (') or double quotes (").

$ retroarch "$*" -c /tmp/retroarch/Data/retroarch/gambatte.cfg
slm
  • 363,520
  • 117
  • 767
  • 871