[Chicago-talk] How to subvert error message.

Mike Schienle mgs at customvisuals.com
Wed Jul 12 08:11:05 PDT 2006


Richard Reina wrote:
> Hello All,
> 
> Is there a way to execute a system command with out the console printing 
> an error message?  I wan't to do system("play soundfile.wav") but I do 
> not want the error message to print out if the file cannot be played. 
> 
> Any help would be greatly appreciated.

You can redirect the stdout and stderr to /dev/null.

play soundfile.wav > /dev/null 2>&1

-- 
Mike Schienle



More information about the Chicago-talk mailing list