I looked at my gawk man page
I read thru the FAQ on passing shell variables
But neither seemed to address my need. I need to pass a shell variable to the search criteria in my gawk command
commandline:
-----------
script aol
-----------
script
-----------
#!/bin/bash
DOMAIN=$1
mailq \
|gawk -v v1=$DOMAIN 'BEGIN{RS=""} /$v1/ { print $1 }'
-----------
mailq gives me the list of emails currently queued. I seem to be able to get the variable into gawk. Just nop into the search criteria.
I read thru the FAQ on passing shell variables
But neither seemed to address my need. I need to pass a shell variable to the search criteria in my gawk command
commandline:
-----------
script aol
-----------
script
-----------
#!/bin/bash
DOMAIN=$1
mailq \
|gawk -v v1=$DOMAIN 'BEGIN{RS=""} /$v1/ { print $1 }'
-----------
mailq gives me the list of emails currently queued. I seem to be able to get the variable into gawk. Just nop into the search criteria.