rename run.sh to example, use required argument - grabtitle - stupid HTML title grabber
HTML git clone git://git.codemadness.org/grabtitle
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 202a253cfb5b88919c479d8abb177de9b4ef9925
DIR parent 20cf1608ad4cae4c89101350da8d11c9f23512b1
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
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(-)
---
DIR 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
DIR 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