0

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?

1

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 &

1

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 &.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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