![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Number of days between two distinct dates | radheymohan | UNIX for Advanced & Expert Users | 1 | 10-16-2007 05:39 AM |
| Find number of days and list out the dates in between | Raynon | Shell Programming and Scripting | 2 | 02-12-2007 05:52 PM |
| Getting week number of the month | sbasetty | Shell Programming and Scripting | 21 | 11-06-2006 03:13 PM |
| month value in number | aya_r | Shell Programming and Scripting | 1 | 08-22-2005 08:40 PM |
| Days of the month | Anamika | UNIX for Dummies Questions & Answers | 6 | 10-20-2004 08:06 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Calc number of days in a month
Looking for some help on capturing the number of days in a month to set as a loop counter. Any ideas, please let me know.
|
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
cal | awk 'END{print $NF}'
|
|
#3
|
|||
|
|||
|
Thanks for the reply...
I understand the cal and awk but not clear on the 'END{print $NF}' Are you setting the number of fields? ($NF)? |
|
#4
|
||||
|
||||
|
No, I'm telling it to print the last field on the last line. The END block is execute after the entire file has been read, so the current line is the last line.
|
||||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|