summaryrefslogtreecommitdiffstats
path: root/util/t/uriparse/parse-url
blob: cf6f53fdc69f45c13e85a84ff14b97284bddd036 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
set -euf
tempfile="`mktemp /tmp/test.XXXXXXXX`"
trap "/bin/rm -f $tempfile" EXIT INT

uriparse "http://user:pass@domain.tld/path" > $tempfile
. $tempfile
[ "$HOSTN" == "domain.tld" ] && \
    [ $USERNAME == "user" ] && \
    [ $PASSWORD == "pass" ] && \
    [ $URIPATH == "/path" ]