![]() |
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 |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| calculating sum of fields in a file | dsravan | Shell Programming and Scripting | 4 | 01-03-2008 01:00 PM |
| Calculating quantiles in SQL | figaro | UNIX for Dummies Questions & Answers | 3 | 11-20-2007 05:55 PM |
| Calculating the average | kekanap | Shell Programming and Scripting | 2 | 01-26-2007 09:36 AM |
| calculating size of int | apoorvasharma80 | High Level Programming | 10 | 11-01-2006 06:44 PM |
| How to identify week-1 and week-2 | csaha | Shell Programming and Scripting | 1 | 02-16-2006 05:24 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
I knew there was an easier way if I just just a little more clever with the math. I finally got it. Hope you're still reading, ligs, this is much faster...
Code:
#! /usr/bin/ksh year=$1 month=$2 day=$3 # # Get date of last day in 1st week of month dldw1=$(cal $month $year | sed -n '3s/. //gp') # # Calculate day of week ((dow = (day+dldw1+1)%7 )) echo dow = $dow exit 0 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|