~johanvandegriff/unix-shell-programming-revised-edition-programs

unix-shell-programming-revised-edition-programs/time/clock -rw-r--r-- 214 bytes
fc214385Johan Vandegriff added other old scripts, some newer ones too 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
while true
do
hour=`date | cut -c12-13`
min=`date | cut -c15-16`
if [ "$hour" -gt "12" ]
then
  day=pm
  hour=`expr "$hour" '-' '12'`
else
  day=am
fi
echo "press ^C to exit
$hour:$min $day"
sleep 1
done