Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- ########################################################################
- #
- # generator
- # $Id: generator,v 1.2 2021/01/25 21:29:37 elias Exp $
- #
- # Extract the generator-metatag from a web site.
- # Requires GNU sed for the "i" modifier of sed. Yes, I know... ;)
- #
- ########################################################################
- PATH=/bin:/usr/bin
- for i in "$@"
- do
- echo -n "$i\t"
- line=`curl -s "$i" | grep -i \<meta | grep -i generator | sed 1q`
- if [ -z "$line" ]
- then
- echo "WARNING: no generator specified"
- else
- echo $line | sed "s/^.*content=['\"]\\([^'\"]*\\)['\"].*$/\\1/i"
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement