I am trying to format a shell out
str="set @face_date = '20130612'
The below code returns the out as '20130612'
echo $str | cut -d '=' -f2
But the following code is not working
echo "face_date:=TO_DATE("$str | cut -d '=' -f2"),'YYYY/MM/DD');"
Expected Result:
face_date:= to_date('2013-06-12','YYYY/MM/DD');
Thanks in advance for your help
echoin backquote. not sure how newlines are handled though. except for that should work. likeecho "face_date:=TO_DATE("`echo $str | cut -d '=' -f2`"),'YYYY/MM/DD');"disclaimer: haven't tried and i seldom use Unix-land shells.