Created
February 4, 2026 22:50
-
-
Save atomicpages/e8e40d051252b1c935c6fd4425794edf to your computer and use it in GitHub Desktop.
Mock someone's words
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| if [ -z "$1" ]; then | |
| echo "Usage: $0 <text to convert>" | |
| exit 1 | |
| fi | |
| input="$*" | |
| output="" | |
| uppercase=0 | |
| for (( i=0; i<${#input}; i++ )); do | |
| char="${input:$i:1}" | |
| if [[ "$char" =~ [a-zA-Z] ]]; then | |
| if [ $uppercase -eq 0 ]; then | |
| output+="${char:l}" | |
| uppercase=1 | |
| else | |
| output+="${char:u}" | |
| uppercase=0 | |
| fi | |
| else | |
| output+="$char" | |
| fi | |
| done | |
| echo "$output" | pbcopy | |
| echo "$output" | |
| echo "(Copied to clipboard!)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment