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

unix-shell-programming-revised-edition-programs/time/t -rw-r--r-- 170 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
#!/bin/sh
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 "$hour:$min $day"