Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

number with value?

Status
Not open for further replies.

rneve

MIS
Oct 11, 2002
51
EU
I have got a string that says 5-9 or 10-15.
How can I check if today (day of the month) is with value of the string?

I have got the day of the month. I only want to know how my test is going to look like.

Thanks in advance.

 
Hi,
As I understood you
#!/bin/ksh
gr="5-9"
td=8
i=$(echo $gr|cut -d - -f 1)
s=$(echo $gr|cut -d - -f 2)
if [[$td -ge $i && $td -le $s ]]; then
echo Today is in interval $gr
else
echo Today is out of interval $gr
fi

Regards Boris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top