about summary refs log tree commit diff
path: root/src/testsuite/getpid.sh
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2003-04-22 19:27:50 +0000
committerAlexander Barton <alex@barton.de>2003-04-22 19:27:50 +0000
commit0551f688f69419d82dae8a5692e1348d9da2a719 (patch)
treeb865fb93cb4c389c59969c636faa7874b96b2048 /src/testsuite/getpid.sh
parentc74ac55832238562fc9d00c2050f1d8d62c2ad5c (diff)
downloadngircd-0551f688f69419d82dae8a5692e1348d9da2a719.tar.gz
ngircd-0551f688f69419d82dae8a5692e1348d9da2a719.zip
Made scripts mor portable (run on SunOS 5.6 now).
Diffstat (limited to 'src/testsuite/getpid.sh')
-rwxr-xr-xsrc/testsuite/getpid.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/testsuite/getpid.sh b/src/testsuite/getpid.sh
index 8e6c6381..57d59625 100755
--- a/src/testsuite/getpid.sh
+++ b/src/testsuite/getpid.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 # ngIRCd Test Suite
-# $Id: getpid.sh,v 1.2 2002/11/10 14:28:06 alex Exp $
+# $Id: getpid.sh,v 1.3 2003/04/22 19:27:50 alex Exp $
 
 # wurde ein Name uebergeben?
 [ $# -ne 1 ] && exit 1
@@ -18,7 +18,9 @@ fi
 
 # PID ermitteln
 ps $PS_FLAGS > procs.tmp
-pid=$( cat procs.tmp | grep "$1" | awk "{print \$$PS_PIDCOL}" | sort -n | head $HEAD_FLAGS )
+cat procs.tmp | grep "$1" | awk "{print \$$PS_PIDCOL}" | sort -n > pids.tmp
+pid=`head $HEAD_FLAGS pids.tmp`
+rm -rf procs.tmp pids.tmp
 
 # ermittelte PID validieren
 [ "$pid" -gt 1 ] > /dev/null 2>&1