1234567891011121314151617181920212223 |
- #!/bin/bash
-
- dissect() {
- echo $* | perl -pe '
- s|(\w)(/[^/])|$1\n $2|;
- s|\?|\n ?\n |;
- s|#|\n #\n |;
- s|&|&\n |g;'
- echo ""
- }
-
- if [[ -n "$1" ]]; then
- dissect "$1"
- else
- i=0
- while read url;
- do
- if [[ -z "$url" ]]; then exit 0; fi
- i=`expr $i + 1`
- printf "=== url %02d =============================================\n" $i
- dissect "$url"
- done
- fi
|