#!/bin/bash

# example iris
iris() {

cat << EOF
# https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3986.html
ftp://ftp.is.co.za/rfc/rfc1808.txt
http://www.ietf.org/rfc/rfc2396.txt
# the following line will not be parsed as of 2017-10-22
#ldap://[2001:db8::7]/c=GB?objectClass?one
mailto:John.Doe@example.com
news:comp.infosystems.www.servers.unix
tel:+1-816-555-1212
telnet://192.0.2.16:80/
urn:oasis:names:specification:docbook:dtd:xml:4.1.2
# see https://www.centos.org/docs/5/html/CDS/ag/8.0/LDAP_URLs-Examples_of_LDAP_URLs.html
https://www.centos.org/docs/5/html/CDS/ag/8.0/LDAP_URLs-Examples_of_LDAP_URLs.html
ldap://ldap.example.com/dc=example,dc=com??sub?(sn=Jensen)
EOF
}

iris | grep -v "^#" | while read iri
do
  scheme=$(echo $iri | cut -f1 -d:)
  echo $iri> $scheme.iri
done
