Change the line
xterm -e "peerflix "$1" --vlc"
to
xterm -e "peerflix '$1' --vlc"
or
xterm -e "peerflix \"$1\" --vlc"
The first form is equivalent to:
xterm -e "peerflix " $1 " --vlc"
It's not what you were expecting.
Question
I'm trying to use Torrent-Video-Player script but it doesn't works with files that contains spaces. It's a Nautilus script.
#!/bin/bash
xterm -e "peerflix "$1" --vlc"
"test.torrent" -> OK
"test test.torrent" -> Cannot execvp peerflix test : No such file or directory found
La solution
Change the line
xterm -e "peerflix "$1" --vlc"
to
xterm -e "peerflix '$1' --vlc"
or
xterm -e "peerflix \"$1\" --vlc"
The first form is equivalent to:
xterm -e "peerflix " $1 " --vlc"
It's not what you were expecting.