home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / utilities-general / nthday < prev    next >
Text File  |  2005-04-09  |  476b  |  17 lines

  1. #!/bin/bash
  2. # Karsten M. Self Mon Mar 21 16:57:30 PST 2005
  3. # Free use, distribution, and modification with no restrictions, granted.
  4. # NO WARRANTY
  5. # ------------------------------------------------------------------------
  6. # Test if today is the nth weekday of the month.
  7. # ------------------------------------------------------------------------
  8.  
  9. export PATH=3D/usr/bin:/bin
  10.  
  11. NTHDAY=3D$1
  12.  
  13. if [ $(( ( ( $( date +%-d) + 1 ) /7 ) )) -eq $NTHDAY ]
  14.     then true
  15.     else false
  16. fi
  17.