apples723
Posts: 80
Joined: Sat Jun 22, 2013 3:13 pm

Shell Script

Sun Oct 06, 2013 12:26 am

So I have a shell script(.sh) and i have it set to run pianobar to wake me up in the morning the only problem is i can not figure out how to run the command "pianobar" and the have one it logs in press the number "14" so it would choose my station that i like also how would i make it so along with that it with out closing out of pianobar i want to run my weather script to show me the weather? is any of this possible?

WickedPenguin
Posts: 33
Joined: Wed Sep 04, 2013 7:11 pm

Re: Shell Script

Sun Oct 06, 2013 4:08 am

Can you please show your shell script? Its a little hard to determine what exactly you are trying to do.

apples723
Posts: 80
Joined: Sat Jun 22, 2013 3:13 pm

Re: Shell Script

Sun Oct 06, 2013 5:30 pm

WickedPenguin wrote:Can you please show your shell script? Its a little hard to determine what exactly you are trying to do.

Code: Select all

pianobar
#i need some way to have the button 14 pressed to start my station once pianobar started
14
#I want this line belew to run at the same time as pianobar with out closing pianobar
python weather2.py

Carnildo
Posts: 15
Joined: Wed Jan 09, 2013 7:51 am

Re: Shell Script

Sun Oct 06, 2013 7:15 pm

apples723 wrote:
WickedPenguin wrote:Can you please show your shell script? Its a little hard to determine what exactly you are trying to do.

Code: Select all

pianobar
#i need some way to have the button 14 pressed to start my station once pianobar started
14
#I want this line belew to run at the same time as pianobar with out closing pianobar
python weather2.py
Assuming "pianobar" is a command-line program with sensible input standards, try the following:

Code: Select all

# The 'echo "14" |' feeds the text "14" to pianobar's standard input for pianobar to see when it starts running, while the ampersand means "run this in the background"
echo "14" |pianobar &
# And now that the shell script is no longer waiting for pianobar to finish, we can run your python script:
python weather2.py

Return to “Troubleshooting”