shell script


Results 1 to 2 of 2

Thread: shell script

  1. #1
    Join Date
    Mar 2013
    Posts
    3

    shell script

    Any one can help me how to check where the Monday is 1st mony or scond monday

    Thanks in advance

  2. #2
    Join Date
    Oct 2002
    Location
    AZ, USA
    Posts
    110
    I came up with something like
    Code:
    ToDay=$(date +"%u")
    CurDoM=$(date +"%d")
    if [ $ToDay .eq "Mon" ]; then
        if [ $CurDoM .le 7 ]; then
            # # its the first monday of the month
        elif [ $CurDoM .le 14 ]; then
            ## Its the second monday of the month
        fi
    fi
    the nested if could also become a switch case statement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •