Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

generate data

Status
Not open for further replies.

jdespres

MIS
Aug 4, 1999
230
US
I would like to generate that looks like this ::--->

S00 00:00
S01 01:00
S02 02:00
S03 03:00
S04 04:00
S05 05:00
S06 06:00
S07 07:00
S08 08:00
S09 09:00
S10 10:00
S11 11:00
S12 12:00
S13 13:00
S14 14:00
S15 15:00
S16 16:00
S17 17:00
S18 18:00
S19 19:00
S20 20:00
S21 21:00
S22 22:00
S23 23:00

What I have so far ::-->
for num in {00..23}; do echo S$num $num:00 ; done

How do I generate that extra zero on the 0 -> 9 range?

Thanks

Joe Despres

 
If it's Korn shell you are using, do this first...

Code:
typeset -Z2 num

 
Unfortunately Avamar doesn't have ksh available :(

Looks like declare is the same as typeset thou... it doesn't have the "-Z" switch...

Bummer :(

Thanks

Joe Despres
 

#### This worked ::--->
for i in 0{0..9} {10..23}; do echo S$i $i:00; done

Thanks

Joe Despres
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top