using BSD options with ps, they should not be prefixed with a '-';
second, the Linux ps supports both BSD and System V options, so change
the structure of the tests not to warn when both forms work.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22647
dc483132-0cff-0310-8789-
dd5450dbe970
fi
if [ "x$PS_ALL" = "x" ]; then
- ps -axwwu >/dev/null 2>&1
- ps_bsd=$?
-
- ps -ef >/dev/null 2>&1
- ps_sysv=$?
-
- if [ $ps_bsd = 0 -a $ps_sysv = 1 ]; then
- PS_ALL="ps -auxww"
- PS_PID="ps -auxww"
- elif [ $ps_bsd = 1 -a $ps_sysv = 0 ]; then
+ if ps auxww >/dev/null 2>&1; then
+ PS_ALL="ps auxww"
+ PS_PID="ps auxww"
+ elif ps -ef >/dev/null 2>&1; then
PS_ALL="ps -ef"
PS_PID="ps -fp"
else
- PS_ALL="ps -auxww"
- PS_PID="ps -auxww"
+ PS_ALL="ps auxww"
+ PS_PID="ps auxww"
echo "WARNING! Cannot auto-detect ps type, assuming BSD."
fi