I'm making a script that will remove the http:// or https:// from a URL. So far I've got it to remove the http://, but I can't seem to figure out how to modify it so that it will remove either that they input. Here's the code so far:domain=$1inp=${domain//http:'//'}echo $inpI'm needing code that would look something like this:domain=$1inp=${domain//http:'//'} OR ${domain//https:'//'}echo $inpHow would I go about doing this?
How can I use string manipulation to detect and remove two different parts of a string?
bash;text processing;string
POSIX shell script:inp=${domain#http*://}Test:for domain in 'https://foo.bar/baz' 'http://foo.bar/baz' ; do \    inp=${domain#http*://} ; \    echo $inp ; \doneOutput:foo.bar/bazfoo.bar/baz