1234567891011121314151617181920212223242526272829303132 |
- #!/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
- i=0
- while read -r Url;
- do
- if [[ -z "$Url" ]]; then exit 0; fi
- ((i++))
- printf '=== url %02d =============================================\n' $i
- dissect
- done
- fi
- }
-
- main "$@"
|