0

I'm able to successfully run the script below from a terminal in ubuntu 14.04. However, when I close the terminal the vlc process also terminates which I don't want. I've tried using "&" so that it runs in the background, but to no avail (script.sh &). Any suggestions on how to run the script below so that if the terminal is closed, the vlc process does not terminate? Any suggestions would be appreciated.

#!/bin/bash
vlc --extraintf telnet localhost 4212 --vlm-conf /home/test/Videos/temp.vlm
Malanie
  • 5
  • 2

1 Answers1

0

You can use Screen to open "virtual consoles" within a session.

  • To install Screen: sudo apt-get install screen
  • To start a new session: screen
  • To disconnect from a session: Press and release together CTRL+A, followed by D.
  • To get a list of current active sessions: screen -ls
  • To reattach to a session: screen -r <SESSION ID>
  • To start a named session: screen -S <SESSION NAME>
  • To reattach to a named session: screen -r <SESSION NAME>
Christopher H
  • 368
  • 2
  • 18
  • screen solved the issue. Just curious and for the purpose of fully understanding, I never had any issues in using "&" with my bash scripts. I've always been able to close the terminal and the script would continue to run. Any reason why "&" would not work with the bash script in my post? Is vlc a special process? Thanks. – Malanie Aug 13 '20 at 22:32