Last active
August 29, 2015 14:16
-
-
Save asv/a286b8aefb972af8f62c to your computer and use it in GitHub Desktop.
Bash titleize / camelize (bash 4)
This file contains 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
titleize() { | |
local title=$@ | |
local title_arr=( $title ) | |
echo "${title_arr[*]^}" | |
} | |
camelize() { | |
local title=`titleize $@` | |
echo "${title// /}" | |
} |
This file contains 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
$ echo `camelize create user table` | |
CreateUserTable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment