Google didn't help me.
#!/bin/sh
j1=`expr "$1"`
j2=`expr "$2"`
while [ $j1 -le $j2 ]; do
date=$(ncal -e $j1)
month=$($date | cut -f1 -d' ')
if [ $month=="April" ]; then
echo $date
fi
j1=`expr $j1 + 1`
done
I want to print the date of easter only for the years where it is in the month april (in the range between the two years i passed as arguments). But somehow I get the output:
...
April 5 2015
./script.sh: 8: March: not found
March 27 2016
./script.sh: 8: April: not found
April 16 2017
What means "month: not found"? And why does it print March although I only ask for april?
I tried it various ways and there was always some error.
I also need to add the condition that only those dates are printed that are beyond the 20th april, but I am not even able to handle this.
"$j1"
and"$(expr $j1 + 1)"
. – shadowtalker May 31 '17 at 13:47