#!/bin/bash # determine day of week the 15th is for July for various years echo "the day of week the 15th occurs for July for these years" echo "=========================================================" YEARS="1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970" for x in $YEARS do echo "Su Mo Tu We Th Fr Sa - $x" cal 7 $x | grep 15 done echo "========================================================="
the day of week the 15th occurs for July for these years: ========================================================= Su Mo Tu We Th Fr Sa - 1960 10 11 12 13 14 15 16 Su Mo Tu We Th Fr Sa - 1961 9 10 11 12 13 14 15 Su Mo Tu We Th Fr Sa - 1962 15 16 17 18 19 20 21 Su Mo Tu We Th Fr Sa - 1963 14 15 16 17 18 19 20 Su Mo Tu We Th Fr Sa - 1964 12 13 14 15 16 17 18 Su Mo Tu We Th Fr Sa - 1965 11 12 13 14 15 16 17 Su Mo Tu We Th Fr Sa - 1966 10 11 12 13 14 15 16 Su Mo Tu We Th Fr Sa - 1967 9 10 11 12 13 14 15 Su Mo Tu We Th Fr Sa - 1968 14 15 16 17 18 19 20 Su Mo Tu We Th Fr Sa - 1969 13 14 15 16 17 18 19 Su Mo Tu We Th Fr Sa - 1970 12 13 14 15 16 17 18 =========================================================
if the output is sent to a file first, then edited to highlight 15, this would make it easier to see. But we might be able to identify the day of the week some other way... but to highlight 15, a simple command could be inserted in the script above: perl -pi -e 's$15$15$g'
#!/bin/bash # determine day of week the 15th is for July for various years LOG="day-of-the-week-15th-July.txt" echo "the day of week the 15th occurs for July for these years" > $LOG echo "=========================================================" >> $LOG YEARS="1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970" for x in $YEARS do echo "Su Mo Tu We Th Fr Sa - $x" >> $LOG cal 7 $x | grep 15 >> $LOG done echo "=========================================================" >> $LOG perl -pi -e 's$15$15$g' $LOG cat $LOG
--> sh ./loop-date-15-July.txt the day of week the 15th occurs for July for these years ========================================================= Su Mo Tu We Th Fr Sa - 1960 10 11 12 13 14 15 16 Su Mo Tu We Th Fr Sa - 1961 9 10 11 12 13 14 15 Su Mo Tu We Th Fr Sa - 1962 15 16 17 18 19 20 21 Su Mo Tu We Th Fr Sa - 1963 14 15 16 17 18 19 20 Su Mo Tu We Th Fr Sa - 1964 12 13 14 15 16 17 18 Su Mo Tu We Th Fr Sa - 1965 11 12 13 14 15 16 17 Su Mo Tu We Th Fr Sa - 1966 10 11 12 13 14 15 16 Su Mo Tu We Th Fr Sa - 1967 9 10 11 12 13 14 15 Su Mo Tu We Th Fr Sa - 1968 14 15 16 17 18 19 20 Su Mo Tu We Th Fr Sa - 1969 13 14 15 16 17 18 19 Su Mo Tu We Th Fr Sa - 1970 12 13 14 15 16 17 18 =========================================================

ebook:
Full Size
Jeep Buyer's
Guide
ebook:
Practical Suggestions
for Microsoft
Windows
Linux Tackles Microsoft
12 hour Video Course by john:
The Art of Linux System Administration
published by O'Reilly Media
Study Guide for the LPIC-2 Certification Exams
search for:
on the internet, or:
JohnMeister.com-fotos
LinuxMeister-Linux
BibleTech-
Bible overview


An overview of Biblical history:
"Promises and Prophets"

Wagoneers

FULL SIZE JEEPS

JeepMeister
"Jeep is America's
only real sports car."
-Enzo Ferrari


MeisterTech
Diesels +

One Page Overview of Linux Commands

click for an image of the 5 essential Linux commands

An Intro to Linux
AMSOIL product guide,
or, AMSOIL web, or 1-800-956-5695,
use customer #283461

Amsoil dealer since 1983
purchase AMSOIL
at Midway Auto on SR9 in Snohomish,
or at Northland Diesel in Bellingham, WA


SJ - 1962-1991

XJ - 1984-2001

WJ - 1999-2004

KJ - 2002-2007

WK - 2005-2010

Find the recommended
AMSOIL synthetics
for your Jeep

CJ-10A - 1984-1986

Jeepsters

MJ - 1984-1992

Willys - 1946-1965

Other Jeeps (FC)