Problem using shell variable in awk if condition

view full story

http://www.unix.com – Hi friends, I'm having a bit of a problem using shell variable in an awk if statement. Please note that i'm using -v option as listed in many forums but I still don't get it working. Here's my code. Kindly help as I've gone crazy trying to work this out :wall: Code: #!/bin/bash -xv fnStats() { modes=("${!1}") services=("${!2}") dates=("${!3}") prices=("${!4}") for (( i = 0 ; i < ${#dates[@]} ; i++ )) do echo "${dates[$i]}" > /home/sm_stats.txt for (( j = 0 ; j < ${#services[@]} ; j++ )) do for (( k = (HowTos)