Results 1 to 2 of 2

Thread: Shell Script

  1. #1
    Junior Member
    Join Date
    Sep 2006
    Answers
    12

    Shell Script

    how'ld u write a shell script that would check if a date entered in yyyy mm dd format is a saturday. i kno how to write it in mm dd yy format

    Last edited by henri084; 06-18-2007 at 11:07 AM.

  2. #2
    Junior Member
    Join Date
    May 2007
    Answers
    1

    Re: Shell Script

    echo "Enter Date :"
    read ate
    date --date=$ate > /tmp/date
    aday=`cut -c 1-3 /tmp/date`
    if [ $aday = 'Sat' ] ; then
    echo "Saturday at $ate "
    else
    echo "Not saturday at $ate as $aday"
    fi


    Regards,
    Shekhar


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact