can't control pianobar after using echo

Posted by Ubuntuusr22222 on Ask Ubuntu See other posts from Ask Ubuntu or by Ubuntuusr22222
Published on 2012-09-02T20:45:55Z Indexed on 2012/09/02 21:48 UTC
Read the original article Hit count: 134

Filed under:
|
|

I have a script that starts pianobar (pandora player) and autoloads into tty2 after booting. I'm running Ubuntu Precise 12.04.

it's a pretty simple script:

    #!bin/bash
    sleep 5
    echo "2" | pianobar

This works, it selects station 2 and begins playing... but when I try to type in commands it doesn't work (like pushing "p" for pause.) It'll show the letter for a second, then hide it. If I try to exit with ctrl+z it just sits there and I can't use it at all.

If I run this it works fine but doesn't auto-select the second station:

    #!bin/bash
    sleep 5
    pianobar

Is there anyway to write this so it will automatically input "2" and then allow me to control from there? Or am I stuck with having to select 2 every time I boot up?

© Ask Ubuntu or respective owner

Related posts about 12.04

Related posts about bash