xref: /freebsd/contrib/dialog/samples/shortlist (revision 97549c34ecaf74580941fdc9c5bd1050e4b1f6ce)
1#!/bin/sh
2# $Id: shortlist,v 1.2 2011/03/02 00:11:50 tom Exp $
3# make a short listing, which writes to both stdout and stderr.
4
5if test $# != 0
6then
7	count=$1
8else
9	count=10
10fi
11
12while test $count != 0
13do
14	echo "** $count -- `date`"
15	w >&2
16	sleep 1
17	count=`expr $count - 1 2>/dev/null`
18	test -z "$count" && count=0
19done
20