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

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