Awk partial match is not printed
awk -F"," -v var=$test '$1 ~ /^var$/{print}' alpha.txt
I tried hard-coding my var with my actual variable input and I found that this code works. However, when I tried, for example, to /^ppl$/
find a partial match with an apple, it doesn't show up. can anyone give me some guidance as to how I can parse my variable in a command?
+3
source to share