Created
September 8, 2013 10:28
-
-
Save BjornW/6483667 to your computer and use it in GitHub Desktop.
Create multiple directories based on file input. Each line is one directory to create. In this case used to create a directory per site.
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
#!/bin/bash | |
# quick & dirty script to create multiple directories | |
# Load a file with one site per line | |
list=$(<sites.txt) | |
# add the list of sites to an array | |
myarray=( $list ) | |
# for every site in the array create a directory | |
# e.g. burobjorn.nl | |
for n in ${!myarray[@]}; do | |
echo "creating directory ${myarray[$n]}" | |
mkdir ${myarray[$n]} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment