I want to get all lines within specified date. The following pattern prints 15/Jan however when used for awk it gives Fatal Unmatched error.
pattern=$(date -d "2 day ago" +'%d/%b')
awk '$4 ~ $pattern' file.txt
I have tried \ to escape the / sign, so far not successful.