The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-23-2006
bobo bobo is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 148
Unhappy an hour less in 24 hour system

My program:

__________________________________

#!/bin/ksh

DAY=`date +%y%m%d`
H=`date +%H`
M=`date +%M`
day=`date +%m/%d/%y`
let h=$H-1
echo DAY $DAY
echo H $H
echo M $M
echo day $day
echo h $h

_____________________________________

My result:

______________________________________

DAY 061023
H 09
M 38
day 10/23/06
h 8

_______________________________________


My need help:


on the "let h=$H-1" I have the result of number 8; how can I make it 08 ( have the zero in front of 8)


please help