Alain,
use single quotes around the variable:
/usr/bin/awk '/'$var'/ { print }' file_name
HTH,
Best regards,
Vladimir.
"MENEZES, ALAIN" wrote:
> Hi all,
>
> Does anyone know how to use a variable as pattern (between '/') in an
> awk pgm; variable_name or $variable_name between '/' is read as a
> string, but I'd like awk to use the variables value.
>
> Any workaround would also be appreciated
>
> Thanks
>
> ---------------------
> Alain Menezes
> ASLK-CGER Services GIE Tel.: +32 2 228.55.74
> Rue Fossé-aux-Loups, 48 Fax.: +32 2
> 228.83.69
> 1000 Bruxelles Email:
> a.menezes@aslk-cger.be
--
------------------------------------------------------------------------------
"The lyf so short, the craft so long to lerne." Chaucer.
|