changeset 1813:d5b2eb52c760

<oerjan> cat url >bin/url
author HackBot
date Fri, 25 Jan 2013 20:38:02 +0000
parents 2f5b38bf4710
children 28b402caecb0
files bin/url
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/bin/url	Fri Jan 25 20:37:44 2013 +0000
+++ b/bin/url	Fri Jan 25 20:38:02 2013 +0000
@@ -1,7 +1,6 @@
-#!/bin/bash
-if [ "$1" ]
-then
-    echo 'http://codu.org/projects/hackbot/fshg/index.cgi/raw-file/tip/'"$1"
-else
-    echo 'http://codu.org/projects/hackbot/fshg/'
-fi
\ No newline at end of file
+#!/usr/bin/env python
+import sys, urllib
+arg = sys.argv(1)
+if arg == None: print "http://codu.org/projects/hackbot/fshg/"
+else: print urllib.quote(
+    "http://codu.org/projects/hackbot/fshg/index.cgi/raw-file/tip/" . arg)