Code: Select all
#!/bin/sh
cd /usr/bin
./pocketsphinx_continuous | while read LINE; do
case "$LINE" in
$LINE > test.txt
done
Code: Select all
#!/bin/sh
cd /usr/bin
./pocketsphinx_continuous | while read LINE; do
case "$LINE" in
$LINE > test.txt
done
Code: Select all
#!/bin/sh
pocketsphinx_continuous | while read LINE; do
$LINE > test.txt
done
Just looking back at this code, is there an "esac" missing? (hope you don't mind my uneducated guesses.....)H4LF82 wrote:Code: Select all
#!/bin/sh cd /usr/bin ./pocketsphinx_continuous | while read LINE; do case "$LINE" in $LINE > test.txt done
Code: Select all
case $SOME in
*) : ;; #if more than one entry, then each should end with double';'
esac
Code: Select all
#!/bin/sh
pocketsphinx_continuous > /root/test.txt &
Just looking back at this code, is there an "esac" missing? (hope you don't mind my uneducated guesses.....)
how right you both are. im uneducated guessing here too, you understand...'case' must close with 'esac':
Code: Select all
#!/bin/sh
pocketsphinx_continuous > /root/test.txt &
part.READY....
Listening...
Stopped listening, please wait....
Code: Select all
!/bin/sh
pocketsphinx_continuous > /root/test.txt &
if grep -q "yes" /root/test.txt; then
peasymp3autoplay /path/to/Music
fi
done
Code: Select all
awk '/^0/ { print $2 }' ~/test.txt
Code: Select all
READY....
Listening...
Stopped listening, please wait...
000000000: hello
READY....
Listening...
Stopped listening, please wait...
000000001: bye
READY....
Code: Select all
case $wot_u_said in
browser)
defaultbrowser
;;
shutdown)
shutdown
;;
esac
}
Code: Select all
awk '/^0000/ { print $2 }' ~/test.txt
Code: Select all
#!/bin/sh
pocketsphinx_continuous > /root/chatdump.txt &
Code: Select all
Listening...
Stopped listening, please wait...
000000001: Out house
READY....
Listening...
Stopped listening, please wait...
000000002: program
READY....
Listening...
Stopped listening, please wait...
000000003: beginning
READY....
Code: Select all
#!/bin/bash
awk '/^0000/ { print $2 }' /root/chatdump.txt > /root/chat_extract.txt &
Code: Select all
Out house
program
beginning
Code: Select all
#!/bin/bash
sed '$!d' /root/chat_extract.txt > /root/chat_command.txt &
Code: Select all
open browser
new e-mail
forward
backward
next window
last window
open music player
Out house
negative
right
close
Code: Select all
pocketsphinx_continuous -lm 6718.lm -dict 6718.dic
Code: Select all
#!/bin/bash
sed -e :a -e '$q;N;4,$D;ba' /root/chatdump.txt | awk '/^0000/ { print $2 }' > chat_command.txt &
Code: Select all
voice_prompt=`sed -e :a -e '$q;N;4,$D;ba' /root/chatdump.txt | awk '/^0000/ { print $2 }'`
Code: Select all
# pocketsphinx_continuous > chatdump.txt
Code: Select all
#!/bin/bash
while [ "$voice_prompt" != "quit" ] ; do
voice_prompt=`sed -e :a -e '$q;N;4,$D;ba' chatdump.txt | awk '/^0000/ { print $2 }'`
# Line below just for testing:
echo $voice_prompt
# Change "edit" to what ever works best.
if [ "$voice_prompt" == "edit" ]; then
exec leafpad
fi
done