shithub: riscv

Download patch

ref: c251b16db09e31c71e1bd619aa041a13bb3034fc
parent: d33f36ccf9e1d31dcab79889505b767afa8df120
author: stanley lieber <stanley.lieber@gmail.com>
date: Sun Aug 14 19:10:46 EDT 2011

tinyurl: geoff's rewrite accepts multiple URLs

--- a/rc/bin/tinyurl
+++ b/rc/bin/tinyurl
@@ -1,7 +1,6 @@
 #!/bin/rc
-if(! ~ $#* 1) {
-	echo usage: tinyurl http://research.swtch.com/2008/02/hideous-name.html >[1=2]
-	exit usage
+# tinyurl url
+for (url) {
+	hget http://tinyurl.com/api-create.php?url'='$url
+	echo
 }
-hget http://tinyurl.com/api-create.php?url'='$1
-echo
--