#!/user/bin/bash
a=$1
echo $1
awk '$1=="$a"{print $2}' Test.txt
I am trying to assign a value to $a dynamically and check that value in text file using awk. if $1 is equal to $a then it should display $2 in the text file.
A HIGH
B LOW
C MEDIUM
D HELLO
E Hai
I tried passing $a hardcoded in awk and it worked and provided me the expected output but I am not able to pass a variable in that place
#!/user/bin/bash
a=$1
echo $1
awk '/A/ {print $2}' Test.txt
I am looking for a way to pass a value to $a dynamically while running the shell script