Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- INPUT=$*
- STRINGNUM=0
- ary=($INPUT)
- for key in "${!ary[@]}"
- do
- SHORTTMP[$STRINGNUM]="${SHORTTMP[$STRINGNUM]} ${ary[$key]}"
- LENGTH=$(echo ${#SHORTTMP[$STRINGNUM]})
- if [[ "$LENGTH" -lt "100" ]]; then
- SHORT[$STRINGNUM]=${SHORTTMP[$STRINGNUM]}
- else
- STRINGNUM=$(($STRINGNUM+1))
- SHORTTMP[$STRINGNUM]="${ary[$key]}"
- SHORT[$STRINGNUM]="${ary[$key]}"
- fi
- done
- for key in "${!SHORT[@]}"
- do
- say() { local IFS=+;/usr/bin/X11/mplayer -ao alsa -really-quiet -noconsolecontrols "http://translate.google.com/translate_tts?tl=pl&q=${SHORT[$key]}&ie=UTF-8&total=1&idx=0&client=t"; }
- say $*
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement