LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-23-2015, 06:09 AM   #1
tonj
Member
 
Registered: Sep 2008
Posts: 546

Rep: Reputation: 37
linux bash script hangs


I'm running a linux bash script on fedora 20 which plays a vlc video using this command:
Code:
## start video
echo "starting video"
vlc video.mpg --fullscreen

## close vlc
export DISPLAY=:0
xdotool type s
xdotool key ALT+F4
The script starts the video fine and plays it but at the end the video stops and just sits there, the machine seems to be unaware that the video has finished and the script hangs. the xdotool entry work fine in other scripts and I've also tried other commands after the video. How do I get the script to move on to the next step after the video has stopped? Do I need a special command after the video?
 
Old 03-23-2015, 07:47 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,878
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I do not believe that VLC will ever exit automatically after a video has finished playing. I think the behavior is that VLC will either stop or loop, depending on how you have a property set, but it will not exit.
 
Old 03-23-2015, 08:14 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,757

Rep: Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300
looks like vlc has a --play-and-exit option (but probably does not work, exits only at the end of the playlist, if loop is off), and also you can try:
vlc --no-play-and-pause video.mpg vlc://quit.
Need to play a bit ....
 
Old 03-23-2015, 10:29 AM   #4
tonj
Member
 
Registered: Sep 2008
Posts: 546

Original Poster
Rep: Reputation: 37
thanks pan64, "$ vlc --play-and-exit video.mpg --fullscreen" worked perfectly, and so did "$ vlc video.mpg --fullscreen vlc://quit".
 
Old 03-24-2015, 01:36 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,757

Rep: Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300Reputation: 7300
glad to help you
if you really want to say thanks just press yes
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Converting Script from Linux (GNU) Bash 4 to Solaris Bash 2.05 - Any cheat sheet? oly_r Solaris / OpenSolaris 6 05-03-2013 08:25 AM
SSH connection from BASH script stops further BASH script commands tardis1 Linux - Newbie 3 12-06-2010 08:56 AM
(BASH) Works on the command line, hangs as a script -- what's wrong? SilversleevesX Programming 17 08-08-2010 10:19 PM
[SOLVED] 5.15 compiling bash: configure script hangs at "checking where .elc files should go" nescalona Linux From Scratch 2 03-30-2010 03:18 PM
Bash script hangs upon starting another script in the background masea2 Linux - Software 4 11-13-2006 05:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration