Created
October 25, 2021 01:07
-
-
Save JoeDuncko/ed388c59c0fdf21b5b36c3997dfd67bb to your computer and use it in GitHub Desktop.
Capitalize first letter of every file in this directory macOS zsh
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
# Reanme the files to start with a capital letter and end with a 2, | |
# see https://stackoverflow.com/questions/3011625/git-mv-and-only-change-case-of-directory | |
for f in *; do git mv --force "./$f" "./${(C)f[1]}${f[2,-1]}2"; done | |
# Remove the 2 | |
for f in *; do git mv --force "./$f" "./${f%?}"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment