Skip to content

Instantly share code, notes, and snippets.

@Asenar
Last active December 14, 2015 19:19
Show Gist options
  • Save Asenar/5135715 to your computer and use it in GitHub Desktop.
Save Asenar/5135715 to your computer and use it in GitHub Desktop.
#!/bin/bash
# get all, separated by space or kind of
tout=$(grep "<virtualhost\|servername" /usr/local/apache/conf/httpd.conf -i \
| sed "s#<VirtualHost\(.*\):[0-9]*>#\1#" \
| sed "s#.*ServerName \(.*\)#\1#" \
)
count = 0;
# newline one / 2
for i in $tout; do
printf "$i"
if [ $count == 1 ]; then
echo ""
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment