INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

generate data

generate data

(OP)
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

RE: generate data

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

CODE

typeset -Z2 num 

RE: generate data

(OP)
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

RE: generate data

(OP)

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

Thanks

Joe Despres

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close