I'd like to replace all slashes from a web address.
Example address: https://example.com/sub/folder/files/file.txt
Expected result: example.com-sub-folder-files-file.txt
I can strip the https but I seem unable to replace the remaining slashes with:
echo $(echo 'https://example.com/sub/folder/files/file.txt' | sed 's/http[s]*:\/\///')
The above only gives me this:
example.com/sub/folder/files/file.txt
Adding a second sed to replace slashes only removes the first encountered. What am I doing wrong?