functions.inc 698 B

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. #
  3. # ngIRCd Test Suite
  4. # Copyright (c)2002-2004 by Alexander Barton (alex@barton.de)
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. # Please read the file COPYING, README and AUTHORS for more information.
  11. #
  12. # $Id: functions.inc,v 1.1 2004/09/06 22:04:06 alex Exp $
  13. #
  14. # test how to call echo to get output without newline
  15. echo -n | grep -- -n >/dev/null 2>&1
  16. if [ $? -eq 0 ]; then
  17. ECHO_N=""; ECHO_C="\c"
  18. else
  19. ECHO_N="-n"; ECHO_C=""
  20. fi
  21. echo_n()
  22. {
  23. echo $ECHO_N "$*$ECHO_C"
  24. }
  25. # -eof-