substituing $1 one time but not the other



Hello

I want to get the name of a mail file using its message ID.
I 'm using :
grep '^Message-ID: <my id>$' myfolder/* | awk -F ':' '{print $1;}'
and it work fine.
now i want to put this line in a shell script with 2 params: myid and
myfolder

so :
grep '^Message-ID: <$1>$' $2/* | awk -F ':' '{print $1;}'

but it does not work because of the awk argument 'print $1 ' .
the command line is substitued by
grep '^Message-ID: <myid>$' myfolder/* | awk -F ':' '{print myid;}'

how can i tell the shell to not substitute the print $1 ?????



.



Relevant Pages

  • Re: [man bash] help understanding.
    ... > _ At shell startup, set to the absolute file name of the shell or ... > shell script being executed as passed in the argument list. ... Also set to the full file name of each command ... this parameter holds the name of the mail file ...
    (comp.unix.shell)
  • Re: substituing $1 one time but not the other
    ... I want to get the name of a mail file using its message ID. ... how can i tell the shell to not substitute the print $1 ????? ... The reason is that single quotes prevent variable substituion, ... isn't being replaced in the grep argument. ...
    (comp.unix.shell)
  • Re: forward content of mailfile
    ... If there's a single file per message, then "sendmail recipient@domain ... simple shell script iterate over all message files. ... It's also possible to do this with a single mail file, ...
    (comp.mail.misc)