I'm trying to get a value from awk: I try $(), it shows bad substitution:
a=${awk 'BEGIN { last=substr("[Import][2017-10-30 02:30:45 UTC] End",10,23); print last}'}
bash: ${awk 'BEGIN { last=substr("[Import][2017-10-30 02:30:45 UTC] End",10,23); print last}'}: bad substitution
but if I use ``, it works well:
a=`awk 'BEGIN { last=substr("[Import][2017-10-30 02:30:45 UTC] End",10,23); print last}'`
The code in awk works well. I'm trying to use awk to match the last "[Import][2017-10-30 02:30:45 UTC] End" like strings from a file. And the code is used to try.
$()
.