vpalos.com // milk, cookies, segfaults…

URI parsing using Bash built-in features

by Valeriu Paloş on February 3, 2010

A bit of background A while ago I posted an article describing how one could parse complete URIs in Bash using the sed program. Since then, I have realized that there is a better way to do it, a much better way: via Bash built-in pattern matching!  Here are some benefits of this improvement: It […]

Bash URI parser using SED

by Valeriu Paloş on November 16, 2009

Warning! This version is now obsolete! Check out the new and improved version (using only Bash built-ins) here! Here is a command-line (bash) script that uses sed to split the segments of an URI into usable variables. It also validates the given URI since malformed strings produce the text “ERROR” which can be handled accordingly: […]