[MPlayer-users] Bash vs. sh

Tom Evans tevans.uk at googlemail.com
Wed Dec 19 14:09:22 CET 2012


On Wed, Dec 19, 2012 at 12:28 PM, Robin Kluth <commi1993 at gmail.com> wrote:
> Hi at all Mplayer users ;)
>
> I have a very strange issue while using mplayer (and streamripper):
>
> I've created a little script (test.sh) to record a normal shoutcast stream,
> it looks like:
>
> #!/bin/bash
> mplayer -dumpstream http://myserver -dumpfile testfile.mp3
>
> I've used streamripper for this previously, but it generates random bad
> output files (wrong bitrate, kHZ and Codec type (Layer I (or II) instead
> III).
>
> I've tried this with mplayer too, but: same behaviour...?!
>
> Okay, so I made some tests:
>
> If I change the script as follows:
>
> #!/bin/sh
>
> and execute it via:
>
> :# sh test.sh
>
> all is working great!, Tried this several times, and all files seem ok!
>
>
> Went back to bash:
>
> #!/bin/bash
> :# bash test.sh
>
> And again randomly wrong output files!
>
> So, whats the problem? I use bash, to get access to $RANDOM (used in the
> complete script). Why is streamripper/mplayer generating bad output files
> using bash?
>
> Can someone explain this?
>
> Thank you!
>
> Diagnostic-data:
>
> Linux 3.0.46-vs2.3.2.5.2-nc #1 SMP Wed Oct 24 12:28:39 UTC 2012 x86_64
> GNU/Linux
>
> MPlayer 1.0rc3-4.4.4 (C) 2000-2009 MPlayer Team
> Streamripper 1.64.6
>
> Sincerely,
>

I thought on linux, sh and bash were the same thing? Run both variants
with -x and get a full log of what happens. If you still don't see any
difference, try strace'ing the shell script.

Cheers

Tom


More information about the MPlayer-users mailing list