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...