Make it work with POSIX sort (POS arg).
All old sorts understand -k too.
This commit is contained in:
parent
197442ec02
commit
15897030c6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103903
@ -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
|
||||
}
|
||||
|
@ -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;;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user