Posts

Showing posts with the label tutorial

morse script 1

Last night I got it to the point where it'd take single characters of user input and play them as a long beep if 1, a short beep if 0 and error if other. It would only take one digit at a time though; a string of digits was rejected. At that stage it looked like this: #!/bin/bash echo "Enter a sequence of 1s and 0s representing dashes and dots:" read user_input for x in $user_input; do         if [[ $x = 1 ]]         then beep -l 300 -D 50         elif [[ $x = 0 ]]         then beep -l 150 -D 50         else echo "$x is not an acceptable character"         fi done I recognise that this is poorly formed. Anyway, I need it to iterate over each character in the user input. I see references to sed and awk and whatnot, and I don't understand that stuff, so I'm going to use the most basic form I can. I found the answer here : You...

morse script 0

I've been trying to think of good little projects or challenges to undertake, probably in bash, that'd help me develop my knowhow, so when I was in the bath reading Tales of Pirx the Pilot by Stanislaw Lem it gave me the idea of a little morse code testing script. The idea is that it beeps out letters at you and you have to enter the letter you think it is. I guess that then builds to using a file of dictionary words and then maybe sentences from your e-books or whatever, but one step at a time! I have a vague, aspirational notion that this could be worth submitting to Linux Voice, who are soliciting for writers at the moment. might be pie in the sky, but maybe worth a shot. So, what's my approach? Well, my first thought was to use bash, rather than python or antything. I'm looking for a real basic angle. Are there any built-in commands that use the system beep? It seems not in my Arch install, but I quickly find that my instinct to type "beep" is no...