Skip to content

Instantly share code, notes, and snippets.

@veggiemonk
Created July 9, 2015 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veggiemonk/696508a6009a25e52c81 to your computer and use it in GitHub Desktop.
Save veggiemonk/696508a6009a25e52c81 to your computer and use it in GitHub Desktop.
regex
# from hyphen/dash to camelCase
rename 's/-(\w)/\U$1/g' list-of-files
# from camelCase to hyphen/dash
sed -e 's/\([A-Z]\)/-\L\1/g' -e 's/^-//' <<< "MyDirectoryFileLine"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment