about summary refs log tree commit diff stats
path: root/bin/lh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/lh')
-rwxr-xr-xbin/lh4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/lh b/bin/lh
index 4332487..40d747d 100755
--- a/bin/lh
+++ b/bin/lh
@@ -25,7 +25,7 @@ lstrip() {
 # prints all redirect locations
 findredir() {
 	#note: for loop turns all whitespace into newlines
-	for line in $(curl -sIL "$1")
+	for line in $(curl -sIL "$(cat)")
 	do
 		# catch is used to find the line after location:
 		if [ -n "$catch" ]
@@ -44,7 +44,7 @@ findredir() {
 }
 
 # handle redirects. tr removes control characters, so the case statement below works as expected.
-URL=$(findredir|tail -1|tr -d '[:cntrl:]')
+URL=$(echo "$1"|findredir|tail -1|tr -d '[:cntrl:]')
 
 # if there were no redirects, just set URL to the first argument
 [ -z "$URL" ] && URL="$1"