Small curl wrapper meant for handling URLs in shell scripts. Work in progress.
cc -o fwuck fwuck.c -lcurl
$ ./fwuck "http://google.com:443/" -t | grep PORT | cut -d ':' -f 2
443
$ ./fwuck -p <<EOL
SCHEME:https
HOST:google.com
EOL
https://google.com
$ ./fwuck "https://example.com/" -t | sed 's/^HOST:.*$/HOST:google.com/' | ./fwuck -p
https://google.com
$ ./fwuck "https://example.com/" -t
FRAGMENT:
HOST:example.com
PASSWORD:
PATH:/
PORT:
QUERY:
SCHEME:https
USER:
ZONEID:
How to fwuck:
fwuck [OPTIONS] [URL]...
Action flags:
Only one of these may be passed at a time
-t,--take-apart - Take apart a URL into its component parts
-p,--put-together - Assemble a URL from comonent parts
-r,--replace - Replace a part of a URL
Utility Flags:
-h,--help - Print this text
-n,--no-label - Disable printing of labels like 'PORT:' when disassembling a URL