LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-09-2008, 01:44 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 30
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

Last edited by ust; 10-09-2008 at 02:01 AM.
 
Old 10-09-2008, 02:26 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
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.
 
Old 10-09-2008, 02:54 AM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Mr. C. View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to run script on the server from client machine in windows in a perl script vpradeep Linux - Newbie 2 09-01-2008 04:29 AM
MySQL Updates With Null When Perl Script Run From Shell Script ThisGuyIKnow Programming 6 08-12-2008 10:56 AM
Bash Script Help - Trying to create a variable inside script when run. webaccounts Linux - Newbie 1 06-09-2008 03:40 PM
Is a script, run at boot time from init.d, run with root authority? tmbrwolf53 Linux - Server 2 03-31-2007 09:15 PM
on Network Up Script run? On Battery power run script? v2-ncl Linux - General 0 12-08-2003 10:34 AM


All times are GMT -5. The time now is 06:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration