vlc broken by redirect
Gilboa Davara
gilboad at gmail.com
Wed Jan 13 17:35:23 UTC 2010
On Wed, 2010-01-13 at 11:56 -0500, Christian Langer wrote:
>
>
>
> ______________________________________________________________________
> Hi, I seem to have lost vlc. It was working ok til I tried the
> following from http://www.tuxfiles.org/linuxhelp/iodirection.html.
>
> "Like I told you before, files aren't the only places where you can
> redirect the standard output. You can redirect it to devices, too:
> $ cat sound.wav > /dev/audio
>
> As you saw, in the above example the cat command concatenates a file
> named sound.wav and the results are sent to a device
> called /dev/audio. What's the fun here, then? /dev/audio is the audio
> device, and when you send there the contents of a sound file, that
> file is played. So if your sound is properly configured, the above
> command plays the file sound.wav!"
>
> I thought that if I sent a music file to vlc in this way, vlc would
> play it. So I did cat song.mp3 > /usr/bin/vlc. At this point vlc
> stopped working. I looked in /usr/bin and found that vlc had been
> turned into a music file! So I erased it, and removed it via yum.
> Success. Then I reinstalled via yum; success. But the messages now
> are: from terminal:
>
> [chris at localhost bin]$ vlc
> bash: vlc: command not found
>
> >From gui: Could not launch 'VLC media player' Failed to execute child
> process "vlc" (No such file or directory).
>
> Any help? Thanks,
>
> Chris
Simple:
/dev/snd/* and /dev/dsp are device nodes - read special "files" that are
used to communicate with the kernel.
However, /usr/bin/vlc is binary.
As such, while cat file.wav > /dev/audio send a wav stream to be played
by a kernel driver, cat file.mp3 > /usr/bin/vlc trashed the vlc binary.
On more thing, in-order to trash the vlc binary you had to run as root.
I'd advise against using the root account to anything besides
administration tasks.
- Gilboa
More information about the users
mailing list