Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I can play music in my music collection by typing:

'vlc somefile.mp3 &'

Which works great except that I always start receiving some signals from the execution of playing that song.

In the following image the signals I dont want to be receiving is the heapload of information that starts running down the screen after the "play_all" command has been run here:

I don't want to receive those signals, they are irrelevant.

I have already tried adding > /dev/null at the end of the command which I thought would redirect the STDOUT away, but to no avail.

How do I stop receiving signals when running music from the terminal?

share|improve this question
1  
What do you mean with signals? –  Ulrich Dangel Nov 24 '12 at 14:43
    
I've updated the question now. –  Hermann Ingjaldsson Nov 24 '12 at 14:58
add comment

2 Answers

up vote 1 down vote accepted

You can stop receiving the HUP (hang up) signal by using nohup before your execution command, or you can use bash disown command to disable HUP effect for currently running job.

nohup vlc somefile.mp3 &

share|improve this answer
add comment

As nohup will always generate a file with the output to stdout/stderr you should combine it with output redirection.

The output you see in the terminal is the output to stderr.

When you use vlc somefile.mp3 > /dev/null & you only redirect the output of stdout, so you still see the stderr output in the terminal.

To redirect both stdout and stderr and have no file written by nohup you can use nohup vlc somefile.mp3 &> /dev/null &.

share|improve this answer
    
That works when I type it directly but not when I run it through Perl's system() command. –  Hermann Ingjaldsson Nov 24 '12 at 16:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.