summaryrefslogtreecommitdiffstats
path: root/util/bin/hrefs
diff options
context:
space:
mode:
authorEUcancER <root@euer.krebsco.de>2011-08-31 12:52:15 +0200
committerEUcancER <root@euer.krebsco.de>2011-08-31 12:52:15 +0200
commita2e4ac21444fd9af436039ba921e809cfca59ea2 (patch)
treee12c692527bc9b2b373cf0a4956f0ff458045cd7 /util/bin/hrefs
parentefe72ae286caa4ecf88edcbcb619fb0ceb886ca8 (diff)
parentcf46dbc53b36772fb0461b9451337c118e705c55 (diff)
Gigantor Merge!
Conflicts: cholerab/news/Candidate - add Ante scriptum cholerab/shirts/bestellliste - merged as theirs oncology/dpfhack_display - now a submodule add bug-fixing for adv_graphgen, as well as a Makefile
Diffstat (limited to 'util/bin/hrefs')
-rwxr-xr-xutil/bin/hrefs20
1 files changed, 20 insertions, 0 deletions
diff --git a/util/bin/hrefs b/util/bin/hrefs
new file mode 100755
index 00000000..3a1a51de
--- /dev/null
+++ b/util/bin/hrefs
@@ -0,0 +1,20 @@
+#! /bin/sh
+
+_hrefs() {
+ sed -n 's/href="\([^"]\+\)"/\n&\n/gp' |
+ sed -n 's/^href="\([^"]\+\)"$/\1/p'; }
+
+_add_prefix_to_relative_hrefs() {
+ sed '/^http:/!s^'"$1"''; }
+
+_main() {
+ case $# in
+ (0) _hrefs;;
+ (1) _hrefs | _add_prefix_to_relative_hrefs "$1";;
+ (*)
+ echo "bad command line: $0 $*" >&2; exit 23;;
+ esac; }
+
+set -euf
+_main "$@"
+#### end of file.