From 1a8beb2f15ee8d0c444162b5171160901357fb3c Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 24 Dec 2014 17:35:08 -0300 Subject: [PATCH] dsv/dsv: to print to stderr, it's 1>&2 and not 2>&1, stupid ... --- dsv/dsv | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dsv/dsv b/dsv/dsv index f86a445..46d13f4 100755 --- a/dsv/dsv +++ b/dsv/dsv @@ -30,13 +30,13 @@ DSV_DIR=.dsv usage() { - echo "usage: $0 [-p] [-u] " 2>&1 - echo " $0 help" 2>&1 - echo " $0 [ls]" 2>&1 - echo " $0 setup ..." 2>&1 - echo 2>&1 - echo " -p show the path instead of displaying the file " 2>&1 - echo " -u show source URL instead of displaying the file " 2>&1 + echo "usage: $0 [-p] [-u] " 1>&2 + echo " $0 help" 1>&2 + echo " $0 [ls]" 1>&2 + echo " $0 setup ..." 1>&2 + echo 1>&2 + echo " -p show the path instead of displaying the file " 1>&2 + echo " -u show source URL instead of displaying the file " 1>&2 exit 1 } @@ -62,7 +62,7 @@ flush() nm=`echo "$nm" | sed 's/%/%25/g;s|/|%2F|g'` [ -z "$nm" ] && return if [ -z "$url" ]; then - echo "$nm: no URL" 2>&1 + echo "$nm: no URL" 1>&2 exit 1 fi ds=$nm-`basename "$url"` @@ -110,7 +110,7 @@ set_value() D:|d:) url=$value;; Z:|z:) zip=$value;; "") ;; # first iteration - *) echo "unrecognized tag \"$tag\"" 2>&1 + *) echo "unrecognized tag \"$tag\"" 1>&2 exit 1;; esac value= @@ -128,7 +128,7 @@ setup() { for n in "$@"; do if [ ! -r "$n" ]; then - echo "$n: not found" 2>&1 + echo "$n: not found" 1>&2 continue fi # @@ -183,7 +183,7 @@ search() if [ -r "$DSV_DIR/dsv-$name" ]; then file=`sed 1q "$DSV_DIR/dsv-$name"` if [ ! -r "$DSV_DIR/$file" ]; then - echo "$1 -> $file: does not exist" 2>&1 + echo "$1 -> $file: does not exist" 1>&2 exit 1 fi if $path; then @@ -206,7 +206,7 @@ search() fi fi if ! up; then - echo "no data sheet found for \"$1\"" 2>&1 + echo "no data sheet found for \"$1\"" 1>&2 exit 1 fi done