I am facing a problem where I want awk to search for a pattern that comes from a bash variable... Now it looks like:
for i in ${CLASS_LIST[*]}; do
cat log.txt | awk -F ":" '$1 ~ /$i/ {print substr($0, index($0,$2))}'
done
But awk has no output here. If I do it like:
cat log.txt | awk -F ":" '$1 ~ /LABEL/ {print substr($0, index($0,$2))}
it works well... what is wrong in the first example?
Thanks a lot for your help in advance. regards, Joerg