PSCMD="@PSCMD@"
+#
+# On Solaris, you may need to use nawk, or alternatively,
+# add the GNU binaries to your path, such as /usr/xpg4/bin
+#
+AWK=awk
+
# All these are not *really* needed but it makes it
# easier to "steal" this code for the development
# environment where they are different.
fi
# Finally try to extract it from ps
- ${PSCMD} | grep $1 | awk '{ print $1 }' | tr '\n' ' '
+ ${PSCMD} | grep $1 | ${AWK} '{ print $1 }' | tr '\n' ' '
return 0
}
status() {
+ pid=""
# Test syntax.
if [ $# = 0 ] ; then
echo "Usage: status {program}"
echo "$base (pid $pid) is running..."
return 0
else
- pid=`${PSCMD} | awk 'BEGIN { prog=ARGV[1]; ARGC=1 }
+ pid=`${PSCMD} | ${AWK} 'BEGIN { prog=ARGV[1]; ARGC=1 }
{ if ((prog == $2) || (("(" prog ")") == $2) ||
(("[" prog "]") == $2) ||
((prog ":") == $2)) { print $1 ; exit 0 } }' $1`