rename run.sh to example, use required argument - grabtitle - stupid HTML title… | |
git clone git://git.codemadness.org/grabtitle | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 202a253cfb5b88919c479d8abb177de9b4ef9925 | |
parent 20cf1608ad4cae4c89101350da8d11c9f23512b1 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Sat, 31 Mar 2018 16:31:37 +0200 | |
rename run.sh to example, use required argument | |
Diffstat: | |
A example.sh | 15 +++++++++++++++ | |
D run.sh | 10 ---------- | |
2 files changed, 15 insertions(+), 10 deletions(-) | |
--- | |
diff --git a/example.sh b/example.sh | |
@@ -0,0 +1,15 @@ | |
+#!/bin/sh | |
+ | |
+if test x"$1" = x""; then | |
+ echo "usage: $0 <url>" >&2 | |
+ exit 1 | |
+fi | |
+ | |
+url="$1" | |
+curl \ | |
+ -s \ | |
+ -L --max-redirs 3 \ | |
+ -m 5 \ | |
+ -H 'User-Agent:' \ | |
+ "$url" 2>/dev/null | \ | |
+ ./title | |
diff --git a/run.sh b/run.sh | |
@@ -1,10 +0,0 @@ | |
-#!/bin/sh | |
- | |
-url="http://codemadness.org" | |
-curl \ | |
- -s \ | |
- -L --max-redirs 3 \ | |
- -m 5 \ | |
- -H 'User-Agent:' \ | |
- "$url" 2>/dev/null | \ | |
- ./title |