> Wouldn't it be a lot easier to use awk's -v option (that's the > reason it's there): > #!/bin/bash > > TEST="Here" > echo "is a test" | > /usr/bin/awk -v i="$TEST" '{print ("\"" i, $0 ".\"")}'
Cool learn something new, but does it work in the // regex part ?
I don't follow what you mean by "but does it work in the // regex part?" but in awk any variable that is declared by the "v" option can be used, modified, changed, etc in the same way as an awk variable that is defined within the substantive awk script.
AFAIK awk cannot export back into the shell so you have to resort to either making awk write to a [temp] file or turning the entire awk part of your script into a variable.
Robert Thorsby -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
