Using Sed bash Script On Linux To Generate Morse Code Without Sound
Page 1 of 1
Using Sed bash Script On Linux To Generate Morse Code Without Sound
- Code:
#!/bin/sed -rf
# https://www.rosettacode.org/wiki/Morse_code#Python
# usage ./morse.sh
# Convert to uppercase
s/.*/\U&/
# Add lookup table
s/$/\nA.-B-...C-.-.D-..E.F..-.G--.H....I..J.---K-.-L.-..M--N-.O---P.--.Q--.-R.-.S...T-U..-V...-W.--X-..-Y-.--Z--../
# Main loop
:a
s/([A-Z])([^\n]*\n.*\1([-.]+))/\3 \2/
ta
# Remove lookup table
s/\n.*//
# echo hello world! | ./morse.sh
Re: Using Sed bash Script On Linux To Generate Morse Code Without Sound
More
https://unix.stackexchange.com/questions/273318/how-can-convert-characters-into-characters-thatll-produce-beep-noises/273325
- Code:
For every character in string:
If character is '.':
play "shortBeep"
else if character is '-'
play "shortBeep"
play "shortBeep" # or play "longBeep"
else
play "noBeep" # or wait
https://unix.stackexchange.com/questions/273318/how-can-convert-characters-into-characters-thatll-produce-beep-noises/273325
Similar topics
» Linux BASH Script Running Commands and Functions From Bash Script and saving to varables
» Heads Or Tails Game For Linux Bash CLI With Sound
» Linux Bash Dog Age Calculator Script
» Convert MP4 To MP3 Linux Bash Script
» BASH Linux Talking IP Script
» Heads Or Tails Game For Linux Bash CLI With Sound
» Linux Bash Dog Age Calculator Script
» Convert MP4 To MP3 Linux Bash Script
» BASH Linux Talking IP Script
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum