Skip to content

Instantly share code, notes, and snippets.

View WebDevJL's full-sized avatar

Jérémie Litzler WebDevJL

View GitHub Profile
# List all folders in a given directory ($1)
# Source directory contains directories like "my dir - a description"
# We will remove it 2 steps:
# => Remove the spaces
# => Replace .-. in a simple dash.
# => See https://unix.stackexchange.com/questions/86722/how-do-i-loop-through-only-directories-in-bash
for d in $1*/ ; do
echo "current: $d"
#rename ' - ' '-' $d # doesn't work on windows, even with bash install. rename require to install through apt-get.
#rename ' ' '.' $d # doesn't work on windows, even with bash install. rename require to install through apt-get.