[PATCH 2/2] errors to stderr

Geert Stappers <[email protected]>
Newsgroups gmane.linux.debian.devel.embedded
Message-ID <[email protected]>
---
 polystrap.sh |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/polystrap.sh b/polystrap.sh
index 36c3968..e7d7c1b 100755
--- a/polystrap.sh
+++ b/polystrap.sh
@@ -50,12 +50,12 @@ while getopts s:a:d:m:p: opt; do
 done
 shift $(($OPTIND - 1))
 
-[ "$#" -ne 1 ] && { echo "too many positional arguments"; usage; exit 1; }
+[ "$#" -ne 1 ] && { echo 1>&2 "too many positional arguments"; usage; exit 1; }
 
 PLATFORM="$1"
 
-[ ! -r "$PLATFORM" ] && { echo "cannot find target directory: $PLATFORM"; exit 1; }
-[ ! -r "$PLATFORM/multistrap.conf" ] && { echo "cannot read multistrap config: $PLATFORM/multistrap.conf"; exit 1; }
+[ ! -r "$PLATFORM" ] && { echo 1>&2 "cannot find target directory: $PLATFORM"; exit 1; }
+[ ! -r "$PLATFORM/multistrap.conf" ] && { echo 1>&2 "cannot read multistrap config: $PLATFORM/multistrap.conf"; exit 1; }
 
 # source default options
 . "default/config"
@@ -90,8 +90,8 @@ echo "mirror:  $MIRROR"
 echo "pkgs:    $PACKAGES"
 echo "--------------------------"
 
-[ -e "$ROOTDIR.tar" ] && { echo "tarball still exists"; exit 1; }
-[ -e "$ROOTDIR" ] && { echo "root directory still exists"; exit 1; }
+[ -e "$ROOTDIR.tar" ] && { echo 1>&2 "tarball still exists"; exit 1; }
+[ -e "$ROOTDIR" ] && { echo 1>&2 "root directory still exists"; exit 1; }
 
 # create multistrap.conf
 MULTISTRAPCONF=`tempfile -d . -p multistrap`
@@ -122,7 +122,7 @@ if [ $ARCH != "`dpkg --print-architecture`" ]; then
 		armel) cp `which qemu-arm-static` $ROOTDIR/usr/bin;;
 		lpia) cp `which qemu-i386-static` $ROOTDIR/usr/bin;;
 		powerpc) cp `which qemu-ppc-static` $ROOTDIR/usr/bin;;
-		*) echo "unknown architecture: $ARCH"; exit 1;;
+		*) echo 1>&2 "unknown architecture: $ARCH"; exit 1;;
 	esac
 fi
 
-- 
1.7.5.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.