123456789101112131415161718192021222324252627282930 |
- #!/bin/bash
-
- dissect() {
- #
- # Print "dissected" version of $Url
- #
- echo "$Url" | perl -pe '
- s|(\w)(/[^/])|$1\n $2|;
- s|\?|\n ?\n |;
- s|#|\n #\n |;
- s|&|&\n |g;'
- echo ""
- }
-
- main() {
- local Url=$1
- local i=0
- if [[ -n "$Url" ]]; then
- dissect
- else
- while read -r Url;
- do
- ((i++))
- printf '=== url %02d =============================================\n' $i
- dissect
- done
- fi
- }
-
- main "$@"
|