|
|
|
|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Quick Question
Hello There! I am trying to write this SIMPLE script in Bourne Shell but I keep on getting syntax errors. Can you see what I am doing wrong? I've done this before but I don't see the difference. I am simply trying to take the day of the week from our system and when the teachers sign on I want them to see the message of the day, when they exe "Schedule" (the name of this script). Code:
#!/bin/sh case $day in Mon) echo '1st grade please meet in front office conference rm at 2 pm.';; Tue) echo 'No school for students';; Wed) echo 'Kindegarten, Jane will meet you in Saban's room.';; Thu) echo 'Short Faculty meeting in Media Center.';; Fri) echo 'Please remind parents to sign in at front office!';; Sat) echo 'If you are on VPDN, please be sure to logout';; Sun) echo 'Why are you working?, Its Sunday!';; # # esac added code tags for readability --oombera Last edited by oombera; 02-19-2004 at 04:17 PM.. |
| Sponsored Links | ||
|
|
|
|||
|
Thanks for your help. I did change the days to numbers Sunday being one since that is the day our system starts. It did get rid of the syntax error BUT now when I run the script....nothing happens. Any additional ideas. My script now looks like this: Code:
case $day in 1) echo 'why are you working';; 2) echo 'comment 2';; 3) echo 'comment 3.';; 4) echo 'comment 4/reminder.';; 5) echo 'comment6.';; 6) echo 'meetings?';; 7) echo 'vpdn reminders';; esac added code tags for readability --oombera Last edited by oombera; 02-19-2004 at 04:18 PM.. |
|
||||
|
Oh wait, $day is the day of the month, which means it'd be equal to 23 today... you want to use the variable $dayweek, where 0 represents Sunday, 1 is Monday, and so on. Code:
# SHELL VARIABLES: # ---------------- # # YEAR : Year of the session to be processed (2 digit) # DAYYEAR : Julian day of the year # DAY : Day of the Month # MONTH : Month, 1=JAN, 12=DEC # DAYWEEK : Day of the week, 0=SUN, 6=SAT http://www.unavco.ucar.edu/data_supp...k_scripts.html Last edited by oombera; 03-23-2003 at 02:03 PM.. |
|
||||
|
oops lol - magic variables that just know what you'd like them to contain and then set themselves
![]() looks like s93366 got it right in the other thread. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with AWK -- quick question | Probos | Shell Programming and Scripting | 5 | 07-18-2007 05:26 PM |
| quick question | keith.m | AIX | 5 | 12-21-2006 09:27 AM |
| quick sed question | vbm | Shell Programming and Scripting | 2 | 11-09-2006 10:44 PM |
| quick question | pkolishetty | UNIX for Dummies Questions & Answers | 2 | 09-02-2006 12:56 PM |
| Ok quick question | Corrail | Shell Programming and Scripting | 1 | 11-11-2005 01:49 PM |