Skip to content

Instantly share code, notes, and snippets.

@austinogilvie
Created November 5, 2013 01:05
Show Gist options
  • Select an option

  • Save austinogilvie/7312142 to your computer and use it in GitHub Desktop.

Select an option

Save austinogilvie/7312142 to your computer and use it in GitHub Desktop.
convert a string to snake_case
#!/bin/bash
word=$1
word=${word// /_}
word=`echo "$word" | tr '[:upper:]' '[:lower:]'`
echo $word;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment