Make it work with POSIX sort (POS arg).

All old sorts understand -k too.
This commit is contained in:
Andrey A. Chernov 2002-09-24 18:53:46 +00:00
parent 197442ec02
commit 15897030c6
5 changed files with 5 additions and 5 deletions

View File

@ -13,7 +13,7 @@ fi
catmsgs() {
find /var/log -name 'messages.*' -mtime -2 |
sort -t. -r -n +1 -2 |
sort -t. -r -n -k 2,2 |
xargs zcat -f
[ -f /var/log/messages ] && cat /var/log/messages
}

View File

@ -39,7 +39,7 @@ case "$monthly_accounting_enable" in
echo ""
echo "Doing login accounting:"
rc=$(ac -p -w $W.0 | sort -nr +1 | tee /dev/stderr | wc -l)
rc=$(ac -p -w $W.0 | sort -nr -k 2 | tee /dev/stderr | wc -l)
[ $rc -gt 0 ] && rc=1
fi
[ $remove = YES ] && rm -f $W.0;;

View File

@ -54,7 +54,7 @@ case "$daily_status_security_chksetuid_enable" in
find $mount -xdev -type f \
\( -perm -u+x -or -perm -g+x -or -perm -o+x \) \
\( -perm -u+s -or -perm -g+s \) -print0
done | xargs -0 -n 20 ls -liTd | sed 's/^ *//' | sort +10 > ${TMP}
done | xargs -0 -n 20 ls -liTd | sed 's/^ *//' | sort -k 11 > ${TMP}
fi
if [ ! -f ${LOG}/setuid.today ]; then

View File

@ -44,7 +44,7 @@ yesterday=`date -v-1d "+%b %e "`
catmsgs() {
find ${LOG} -name 'auth.log.*' -mtime -2 |
sort -t. -r -n +1 -2 |
sort -t. -r -n -k 2,2 |
xargs zcat -f
[ -f ${LOG}/auth.log ] && cat $LOG/auth.log
}

View File

@ -44,7 +44,7 @@ yesterday=`date -v-1d "+%b %e "`
catmsgs() {
find ${LOG} -name 'messages.*' -mtime -2 |
sort -t. -r -n +1 -2 |
sort -t. -r -n -k 2,2 |
xargs zcat -f
[ -f ${LOG}/messages ] && cat $LOG/messages
}