![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| pickup until last friday files from directory | magi | Shell Programming and Scripting | 1 | 12-14-2007 03:26 PM |
| IBM to ship new AIX 6 Unix on Friday - Computerworld | iBot | UNIX and Linux RSS News | 0 | 11-06-2007 04:20 PM |
| how can i find the third friday of each month? | leslie02 | Shell Programming and Scripting | 10 | 05-31-2007 09:45 AM |
| Friday afternoon headache | _Spare_Ribs_ | Shell Programming and Scripting | 4 | 12-18-2006 10:38 AM |
| quoting echo 'it's friday' | yls177 | UNIX for Dummies Questions & Answers | 3 | 09-19-2002 11:09 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Need help, Every friday in a month
I am trying to write a script that shows every Friday in a month.
I used cal $1 $2 | grep -v "^$" | awk '{print $6}' It doesn't work for the frist week of Friday because calendar command output has some spaces in the first line and awk '{print $6}' doesn't work. Anybody help me with this problem? |
|
||||
|
explanation
command
cal 12 2006 Note:The result has not aligned properly,check in your OS box. EDIT -- It is aligned now because I added code tags and restored the original spacing of the output. -- Perderabo Code:
December 2006
S M Tu W Th F S
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
then starting from 3rd line get the starting character as 16 and number of characters as 2,as Friday dates starts from 16th character (fixed ). Regards, cskumar. Last edited by Perderabo; 12-09-2006 at 10:35 AM.. Reason: Add code tags for readability |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|