script to run monthly
by rvsr from LinuxQuestions.org on (#5GXMD)
Hi all,
Firstly I am new to bash script.
I want to run this script every month (which is inside the forloop) and if should execute only execute when the $b matches $a.I want this count to be executed in both cases
I am not sure if this is the right way to do it. can you please suggest.
Code:b=$(date +"%Y%m%d)
a=$(date +"%Y1030)
count = 0
for VARIABLE in file1
do
command1 on $VARIABLE
command2
if [ $b == $a ]
then
command 1
command 2
count = count +1
fi;
done


Firstly I am new to bash script.
I want to run this script every month (which is inside the forloop) and if should execute only execute when the $b matches $a.I want this count to be executed in both cases
I am not sure if this is the right way to do it. can you please suggest.
Code:b=$(date +"%Y%m%d)
a=$(date +"%Y1030)
count = 0
for VARIABLE in file1
do
command1 on $VARIABLE
command2
if [ $b == $a ]
then
command 1
command 2
count = count +1
fi;
done