Sponsored Content
Top Forums UNIX for Dummies Questions & Answers shell scripting - gives a message on Fridays and a countdown on other business days. Post 302517465 by citizencro on Tuesday 26th of April 2011 11:11:26 PM
Old 04-27-2011
MySQL Thank you very much!!!

This worked and was very helpful and appreciated... Thanks, citizencro
 

8 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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
CALENDAR(1)						    BSD General Commands Manual 					       CALENDAR(1)

NAME
calendar -- reminder service SYNOPSIS
calendar [-ab] [-A num] [-B num] [-l num] [-w num] [-f calendarfile] [-t [[[cc]yy]mm]dd] DESCRIPTION
The calendar utility checks the current directory or the directory specified by the CALENDAR_DIR environment variable for a file named calendar and displays lines that begin with either today's date or tomorrow's. On Fridays, events on Friday through Monday are displayed. The options are as follows: -A num Print lines from today and next num days (forward, future). Defaults to one. (same as -l) -a Process the ``calendar'' files of all users and mail the results to them. This requires superuser privileges. -B num Print lines from today and previous num days (backward, past). -b Enforce special date calculation mode for KOI8 calendars. -l num Print lines from today and next num days (forward, future). Defaults to one. (same as -A) -w num Print lines from today and next num days, only if today is Friday (forward, future). Defaults to two, which causes calendar to print entries through the weekend on Fridays. -f calendarfile Use calendarfile as the default calendar file. -t [[[cc]yy]mm]dd Act like the specified value is ``today'' instead of using the current date. If yy is specified, but cc is not, a value for yy between 69 and 99 results in a cc value of 19. Otherwise, a cc value of 20 is used. To handle calendars in your national code table you can specify ``LANG=<locale_name>'' in the calendar file as early as possible. To handle national Easter names in the calendars, ``Easter=<national_name>'' (for Catholic Easter) or ``Paskha=<national_name>'' (for Orthodox Easter) can be used. A special locale name exists: 'utf-8'. Specifying ``LANG=utf-8'' indicates that the dates will be read using the C locale, and the descrip- tions will be encoded in UTF-8. This is usually used for the distributed calendar files. The ``CALENDAR'' variable can be used to specify the style. Only 'Julian' and 'Gregorian' styles are currently supported. Use ``CALENDAR='' to return to the default (Gregorian). To enforce special date calculation mode for Cyrillic calendars you should specify ``LANG=<local_name>'' and ``BODUN=<bodun_prefix>'' where <local_name> can be ru_RU.KOI8-R, uk_UA.KOI8-U or by_BY.KOI8-B. Note that the locale is reset to the user's default for each new file that is read. This is so that locales from one file do not accidentally carry over into another file. Other lines should begin with a month and day. They may be entered in almost any format, either numeric or as character strings. If proper locale is set, national months and weekdays names can be used. A single asterisk (`*') matches every month. A day without a month matches that day of every week. A month without a day matches the first of that month. Two numbers default to the month followed by the day. Lines with leading tabs default to the last entered date, allowing multiple line specifications for a single date. ``Easter'' (may be followed by a positive or negative integer) is Easter for this year. ``Paskha'' (may be followed by a positive or negative integer) is Orthodox Easter for this year. Weekdays may be followed by ``-4'' ... ``+5'' (aliases last, first, second, third, fourth) for moving events like ``the last Monday in April''. By convention, dates followed by an asterisk ('*') are not fixed, i.e., change from year to year. Day descriptions start after the first <tab> character in the line; if the line does not contain a <tab> character, it isn't printed out. If the first character in the line is a <tab> character, it is treated as the continuation of the previous description. The calendar file is preprocessed by cpp(1), allowing the inclusion of shared files such as company holidays or meetings. If the shared file is not referenced by a full pathname, cpp(1) searches in the current (or home) directory first, and then in the directory directory /etc/calendar, and finally in /usr/share/calendar. Empty lines and lines protected by the C commenting syntax (/* ... */) are ignored. Some possible calendar entries (a sequence denotes a <tab> character): LANG=C Easter=Ostern #include <calendar.usholiday> #include <calendar.birthday> 6/15 June 15 (if ambiguous, will default to month/day). Jun. 15 June 15. 15 June June 15. Thursday Every Thursday. June Every June 1st. 15 * 15th of every month. May Sun+2 second Sunday in May (Muttertag) 04/SunLast last Sunday in April, summer time in Europe Easter Easter Ostern-2 Good Friday (2 days before Easter) Paskha Orthodox Easter FILES
calendar File in current directory. ~/.calendar Directory in the user's home directory (which calendar changes into, if it exists). ~/.calendar/calendar File to use if no calendar file exists in the current directory. ~/.calendar/nomail calendar will not send mail if this file exists. calendar.all International and national calendar files. calendar.birthday Births and deaths of famous (and not-so-famous) people. calendar.christian Christian holidays (should be updated yearly by the local system administrator so that roving holidays are set cor- rectly for the current year). calendar.computer Days of special significance to computer people. calendar.croatian Croatian calendar. calendar.discord Discordian calendar (all rites reversed). calendar.fictional Fantasy and fiction dates (mostly LOTR). calendar.french French calendar. calendar.german German calendar. calendar.history Miscellaneous history. calendar.holiday Other holidays (including the not-well-known, obscure, and really obscure). calendar.judaic Jewish holidays (should be updated yearly by the local system administrator so that roving holidays are set correctly for the current year). calendar.music Musical events, births, and deaths (strongly oriented toward rock n' roll). calendar.openbsd OpenBSD related events. calendar.pagan Pagan holidays, celebrations and festivals. calendar.russian Russian calendar. calendar.space Cosmic history. calendar.ushistory U.S. history. calendar.usholiday U.S. holidays. calendar.world World wide calendar. SEE ALSO
at(1), cal(1), cpp(1), mail(1), cron(8) STANDARDS
The calendar program previously selected lines which had the correct date anywhere in the line. This is no longer true: the date is only recognized when it occurs at the beginning of a line. COMPATIBILITY
The calendar command will only display lines that use a <tab> character to separate the date and description, or that begin with a <tab>. This is different than in previous releases. The -t flag argument syntax is from the original FreeBSD calendar program. The -l and -w flags are Debian-specific enhancements. Also, the original calendar program did not accept 0 as an argument to the -A flag. Using 'utf-8' as a locale name is a Debian-specific enhancement. HISTORY
A calendar command appeared in Version 7 AT&T UNIX. BUGS
calendar doesn't handle all Jewish holidays or moon phases. BSD
September 13, 2011 BSD
All times are GMT -4. The time now is 08:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy