Results 1 to 2 of 2
Hello, im very new to linux and new to programming as well and i need to write a script for lircd to send to my tv box.
Here is the ...
- 08-03-2007 #1Just Joined!
- Join Date
- Aug 2007
- Posts
- 2
lirc remote script help
Hello, im very new to linux and new to programming as well and i need to write a script for lircd to send to my tv box.
Here is the basic channel change script that parses what the user enters and sends it to the unit
filename channelchange.sh
#!/bin/bash
REMOTE_NAME=DCR
for digit in $(echo $1 | sed -e 's/./& /g'); do
irsend --device=/dev/lircd1 SEND_ONCE $REMOTE_NAME $digit
sleep 0.3
done
irsend --device=/dev/lircd1 SEND_ONCE $REMOTE_NAME OK
so basically if i type channelchange.sh 23 it will send a 2 then wait .3 seconds then send another 2 then wait .3 then send ok to the unit.
What i want to do is change some settings on the fly on my box by sending it a string of commands.
example (hex)
$ channelchange.sh 1AE44
i want that to send this to my box
1
wait .3
program guide (A= the program guide)
wait .3
favorites (E= favorites)
wait .3
4
wait .3
4
wait .3
ok (to submit information)
Thats all i want to do i just need the basic code because i have other commands i want to issue as well but this will help me to figure it out.
Thanks for any help you can give.
- 08-03-2007 #2Just Joined!
- Join Date
- Aug 2007
- Posts
- 2
Some Progress
I having some progress but something weird happens. Both of these commands in this file work but only when there are about 3 sed commands. Anything over and the output gets garbled for some reason and i cant figure it out. Here is the fil.
#!/bin/bash
#for digit in $(echo $1 | sed -e 's/[Aa]/PAUSE/g' -e 's/[Bb]/AUDIOQ/g' \
#-e 's/[Cc]/EPG/g' -e 's/[Dd]/LAST/g' -e 's/[Ee]/FAV/g' -e 's/[Ff]/SAT/g' ); do
#echo $digit
#done
echo $1 |
sed '
s/[Aa]/PAUSE/g
s/[Bb]/AUDIOQ/g
s/[Cc]/EPG/g
s/[Dd]/LAST/g
s/[Ee]/FAV/g
s/[Ff]/SAT/g'


Reply With Quote