shell scripting - gives a message on Fridays and a countdown on other business days.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers shell scripting - gives a message on Fridays and a countdown on other business days.
# 1  
Old 04-26-2011
shell scripting - gives a message on Fridays and a countdown on other business days.

Hey - I need to write a shell script that gives a message on Fridays and a countdown on other business days. ("Today is Thursday, one day to go to Friday") I don't know if I should be scheduling a job for friday using the crontab command? Basically i'm totally lost. Any help would be greatly appreciated..... Thanks, citizencro.......
# 2  
Old 04-26-2011
Gives a message in response to what, and puts it where?
# 3  
Old 04-26-2011
I need it to say "today is friday, tgif" on friday, then on sat, sun, mon etc, I need it to display sat - 6 days left, sun 5 days left, mon 4 days left, etc...... Thanks for the response...
# 4  
Old 04-26-2011
Yes, but display it when? On login? At midnight? When a command is run?

And where? in the motd? On every logged-in shell? On a webpage banner?
# 5  
Old 04-26-2011
on login, in the message of the day..... Although the question was not specific, just asked for a shell script displaying the above.
# 6  
Old 04-26-2011
Code:
case $(date +%w) in
5)     # Friday
        echo stuff
        ;;
*)
        echo something else
        ;;
esac

You might be able to put this in /etc/profile, though you'll need to be careful to do so only for login shells...
# 7  
Old 04-27-2011
MySQL Thank you very much!!!

This worked and was very helpful and appreciated... Thanks, citizencro
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Should pick latest file within past 3 days using UNIX script and perform steps in message below.

Hi , Can anyone help me how do perform below requirement in unix. Step1:we will receive multiple files weekly with same name(as below) in a folder(In folder we will have other files also def.dat,ghf.dat) Filenames: 1) abc_20171204_052389.dat 2)abc_20171204_052428.dat DON'T modify... (23 Replies)
Discussion started by: sunnykamal59
23 Replies

2. Shell Programming and Scripting

Get business days including today's date

I am trying to get last 5 business day . trying for d in Mon Tue Wed Thu Fri do date +%Y%m%d -d "last $d" done gives me date Thu Oct 20 23:56:26 EDT 2016 20161017 20161018 20161019 20161013 20161014 expected output should be 20161017 20161018 20161019 20161020 (2 Replies)
Discussion started by: abhii
2 Replies

3. How to Post in the The UNIX and Linux Forums

Get all business days from week including today

I am trying to get last 5 business day . trying for d in Mon Tue Wed Thu Fri do date +%Y%m%d -d "last $d" done gives me date Thu Oct 20 23:56:26 EDT 2016 20161017 20161018 20161019 20161013 20161014 expected output should be 20161017 20161018 20161019 20161020 (1 Reply)
Discussion started by: abhii
1 Replies

4. UNIX for Dummies Questions & Answers

How to get fridays date of each week

Hi, I have a requirement, to pass Fridays date to my job. Here im using ESP scheduler to run the job, but ESP can only pass the date on which it is running. It passes saturday date if it runs on sturday. I can schedule my job on friday so that it can pass firday date, but if for some reason... (6 Replies)
Discussion started by: suman473
6 Replies

5. Shell Programming and Scripting

Scheduling Cron Jobs on Business Days

Hello, is it possible to schedule cron jobs using business days instead of calendar days? I need to run several jobs on first and third business days of the month. I currently have this cron-tab entry which runs every week day at 5 AM. I need to schedule the same job on the 3rd Business day of the... (8 Replies)
Discussion started by: Pramodini Rode
8 Replies

6. Shell Programming and Scripting

Stop! (the countdown!) :-) shell script help

Hi guys, I've found two nifty little scripts on these forums one which detects if the F5 key has been pressed: #/bin/sh _key() { local kp ESC=$'\e' _KEY= read -d '' -sn1 _KEY case $_KEY in "$ESC") while read -d '' -sn1 -t1 kp do _KEY=$_KEY$kp ... (0 Replies)
Discussion started by: rich@ardz
0 Replies

7. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

8. UNIX for Dummies Questions & Answers

shell script - loop to countdown

I am taking a class in UNIX and have written a script that needs to countdown from a number that is read in from the keyboard to zero. If no number is given the start of the countdown should default to 10. I can't get this to do the default #! /bin/sh echo Enter a number here to countdown... (2 Replies)
Discussion started by: froggwife
2 Replies
Login or Register to Ask a Question