Skip to content

Instantly share code, notes, and snippets.

@Asenar Asenar/devnet.noob.sh
Last active Dec 14, 2015

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
You can’t perform that action at this time.