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
- test -n "$Url" \
- && dissect \
- && return 0
- grep . \
- | while read -r Url;
- do
- ((i++))
- printf '=== url %02d =============================================\n' $i
- dissect
- done
- }
-
- main "$@"
|