Skip to content

Instantly share code, notes, and snippets.

@Asenar
Last active December 14, 2015 19:19
Embed
What would you like to do?
#!/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