Shell Variable in Curly Brackets Returns Empty Value

view full story

http://www.unix.com – Hello Team, I have a script which will grep for a time from a file. I have following code to grep for a time in a file. Code: node=`hostname` current_date=`date` file11=weblogic.log next_date=`date '+%b %e, %Y'` next_date_time11=`grep -i "${#next_date}" ${file11}| tail -1 | awk '{print $4}'` When I do echo to variable next_date_time11 it returns null value. I am trying to get time from the below file. I am unable to do that. Kindly help Below is the file content :- Code: <May 2, 2012 1:14:50 PM MEST> <Error> <HTTP> <BEA-101214> <Include (HowTos)