summaryrefslogtreecommitdiff
path: root/fmt/snake
blob: e33b678bfd3bc5890a7df70051ac49f15f5b4181 (plain) (blame)
1
2
3
4
#!/bin/sh
# snake: convert_a_string_into_snake_case

echo "$1" | tr ' ' '_' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-zA-Z0-9_]//g'