[Pkg-shadow-commits] r3447 - debian/trunk/tests/log/lastlog/03_lastlog_format
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Tue Jul 26 15:25:15 UTC 2011
Author: nekral-guest
Date: 2011-07-26 15:25:15 +0000 (Tue, 26 Jul 2011)
New Revision: 3447
Modified:
debian/trunk/tests/log/lastlog/03_lastlog_format/lastlog.test
Log:
Fix TTY detection. use the lowest unused TTY ID.
Modified: debian/trunk/tests/log/lastlog/03_lastlog_format/lastlog.test
===================================================================
--- debian/trunk/tests/log/lastlog/03_lastlog_format/lastlog.test 2011-07-26 15:23:49 UTC (rev 3446)
+++ debian/trunk/tests/log/lastlog/03_lastlog_format/lastlog.test 2011-07-26 15:25:15 UTC (rev 3447)
@@ -22,8 +22,13 @@
cp data/lastlog.out tmp/lastlog.out1
cp data/lastlog.out tmp/lastlog.out2
-TTY=$(ls /dev/pts | sort -n|tail -1)
-TTY=$((TTY+1))
+TTY=0
+while true
+do
+ [ ! -e /dev/pts/$TTY ] && break
+ TTY=$((TTY+1))
+done
+
DATE=$(LC_ALL=C date +"%a %b %e %H:%M:%S %z %Y")
printf "%-16s %-8.8s %-16.16s %s\n" foo "pts/$TTY" "" "$DATE" >> tmp/lastlog.out1
More information about the Pkg-shadow-commits
mailing list