LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   run script (https://www.linuxquestions.org/questions/linux-newbie-8/run-script-675242/)

ust 10-09-2008 12:44 AM

run script
 
I would like to have a simple script to do that

if today is Mon , then do "xxx" , if today is Tue , then do "yyy" , if today is Wed , then do "zzz" ,

can advise how to write the script ?

thx

Mr. C. 10-09-2008 01:26 AM

Code:

#!/bin/bash

dayofweek=$(date +%a)

case $dayofweek in
    Mon)
        echo Do xxx
        ;;
    Tues)
        echo Do yyy
        ;;
    Wed)
        echo Do zzz
        ;;
    *)
        echo unknown day of week
        ;;
esac

You fill in the remaining days.

ust 10-09-2008 01:54 AM

Quote:

Originally Posted by Mr. C. (Post 3304910)
Code:

#!/bin/bash

dayofweek=$(date +%a)

case $dayofweek in
    Mon)
        echo Do xxx
        ;;
    Tues)
        echo Do yyy
        ;;
    Wed)
        echo Do zzz
        ;;
    *)
        echo unknown day of week
        ;;
esac

You fill in the remaining days.

thx a lot

Ora


All times are GMT -5. The time now is 07:31 PM.