there is file abc.txt. I have to find out whether the below values is present in a file or not.
20110101
20110415
20110611
if present, add 1 to the date and store in a variable.
Expecting this .. ?
lcnt=$(egrep "20110101|20110415|20110611" abc.txt | wc -l)
[ $lcnt -eq 3 ] && var=$(echo "$(date +%Y%m%d) + 1" | bc) || echo "Lines not present"
Your requirement is not tacit.Please elaborate.