From 450251f082e0d9b4b1cbdf803e061ca5b5fcf9ab Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Mon, 6 Sep 2004 22:04:06 +0000 Subject: Fixed echo without newline for systems not understanding "echo -n"; added new file "functions.inc" for functions usable by all test scripts. --- src/testsuite/functions.inc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/testsuite/functions.inc (limited to 'src/testsuite/functions.inc') diff --git a/src/testsuite/functions.inc b/src/testsuite/functions.inc new file mode 100644 index 00000000..e03499e5 --- /dev/null +++ b/src/testsuite/functions.inc @@ -0,0 +1,28 @@ +#!/bin/sh +# +# ngIRCd Test Suite +# Copyright (c)2002-2004 by Alexander Barton (alex@barton.de) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# Please read the file COPYING, README and AUTHORS for more information. +# +# $Id: functions.inc,v 1.1 2004/09/06 22:04:06 alex Exp $ +# + +# test how to call echo to get output without newline +echo -n | grep -- -n >/dev/null 2>&1 +if [ $? -eq 0 ]; then + ECHO_N=""; ECHO_C="\c" +else + ECHO_N="-n"; ECHO_C="" +fi + +echo_n() +{ + echo $ECHO_N "$*$ECHO_C" +} + +# -eof- -- cgit 1.4.1