joe joe - 1 month ago 26
Bash Question

Raspbian (jessie) open new terminal window

I'm pretty new to Linux / Raspberry PI.

I want to run a command from a shell script in a new shell window since commands like "cvlc music.mp3" (VLC PLAYER) would block the shell until playback has beenn finished.

Therefore it would be nice to export the playback command to another shell

Is this correct?
gnome-terminal && lxterminal don't seem to be an option for the distribution

for testing purpose I created two dumnmy shell-scripts:

[start.sh]

#!/bin/sh
lxterminal\
--title="MyScriptWindow" \
-e "bash -c ./exe.sh;bash"\
[exe.sh]

#!/bin/sh
echo "Hello World"


[output]

root@raspberrypi:/home/pi# ./start.sh

(lxterminal:1315): Gtk-WARNING **: cannot open display:

Answer

If I've understood correctly, you are doing all this only because you want the shell to be released at the execution of your cvlc.

You only need to detach it from shell standard output and run it as a background process


nohup cvlc music.mp3 &

is this enought ?