Nooby question:
I am trying to use a variable in a 'match' expression but am having no luck. Can anyone advise how i should be doing this.
This works:
$4 ~ /@domain.com/ { print NR "\t" # $0 }
But this does not:
variable="@domain.com"
$4 ~ /$variable/ { print NR "\t" # $0 }
Shaun.
I am trying to use a variable in a 'match' expression but am having no luck. Can anyone advise how i should be doing this.
This works:
$4 ~ /@domain.com/ { print NR "\t" # $0 }
But this does not:
variable="@domain.com"
$4 ~ /$variable/ { print NR "\t" # $0 }
Shaun.