Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Note that this assumes that the value of the variable does not contain backslashes, as the argument to awk -v jj=$j '...' undergoes backslash expansion.
You have to pass the $j shell variable to awk: awk -v jj=$j '...'
You have to pass the $j shell variable to awk:
awk -v jj="$j" '...'
Note that this assumes that the value of the variable does not contain backslashes, as the argument to awk -v undergoes backslash expansion.