Re: substituing $1 one time but not the other



2006-09-27, 18:44(+02), patrice:
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;}'
[...]

Looks like you want

grep -l "^Message-ID: <$1>\$" -- "$2"/*

--
Stéphane
.