Skip to content

Instantly share code, notes, and snippets.

@apperceive
Created November 11, 2015 08:20
Show Gist options
  • Save apperceive/a05c576accc6a9249724 to your computer and use it in GitHub Desktop.
Save apperceive/a05c576accc6a9249724 to your computer and use it in GitHub Desktop.
bash command line to iterate over a pattern of folders and create index.html's with name inside
for f in $(find /var/www -maxdepth 2 -type d -regextype awk -regex '.*(dev|test)\.apperceive\.(com|net)' -exec echo {} \;); do echo "Welcome to $f" | sed 's~/var/www/html/~~' > $f/public/index.html; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment