Script-arguments with spaces

Karl Voit devnull at Karl-Voit.at
Sat Aug 18 23:37:45 UTC 2012


Hi Nils!

* Nils Kassube <kassube at gmx.net> wrote:
> Karl Voit wrote:
>> /usr/bin/gnome-terminal -e "/home/vk/tmp/2del/mytest/mypy.py ${@}"
>> xterm -e /home/vk/tmp/2del/mytest/mypy.py ${@}
>
> Well, I'm not familiar with gnome-terminal but with xterm this should 
> work:
>
> #!/bin/bash
> /usr/bin/xterm -e /home/vk/tmp/2del/mytest/mypy.py "$@"

Yes! :-)

Thanks for your input!

The reason why I did not tried this one was that I thought that the
argument after «-e» has to be quoted to be recognized as one
single argument. I was wrong with this assumption when using xterm.

In xterm, «-e» has to be the *last* argument. This way, it is able
to do the trick as shown by your email.

For anybody who wants to do this with gnome-terminal as well: there
is an additional option «-x» which takes *remaining* command line as
one single argument just like the «-e» option of xterm does.

Annoying problem for me for too long but now I got it, thanks!

-- 
Karl Voit





More information about the ubuntu-users mailing list