akohan
asked on
passing timing parameters
Hello group,
In part of my code, I have to call a function which in there I should pass parametrs like Year, month, day and hour. So, basically, user will call the exectuable file like:
$ ./prog 2008 11 3 0
which in fact is year 2008, month = Nov, first day of month and hour = 0 a.m. or TODAY!
note that 0 = 12 a.m.
so now in order to make it more user-friendly I'm thinking of passing some pre-defined tokens like
$ ./prog today
$ ./prog yesterday
or
$ ./prog week
Question:
1) Is it ok to create a CASE block for these tokens?
2) how should I handle today or TODAY or tOdAY ?
Regards.
In part of my code, I have to call a function which in there I should pass parametrs like Year, month, day and hour. So, basically, user will call the exectuable file like:
$ ./prog 2008 11 3 0
which in fact is year 2008, month = Nov, first day of month and hour = 0 a.m. or TODAY!
note that 0 = 12 a.m.
so now in order to make it more user-friendly I'm thinking of passing some pre-defined tokens like
$ ./prog today
$ ./prog yesterday
or
$ ./prog week
Question:
1) Is it ok to create a CASE block for these tokens?
2) how should I handle today or TODAY or tOdAY ?
Regards.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Everybody has come up with nice solution and also links.
Thanks!