bash - delay expansion of variable

Hello -

I have a bash script which does some logging, and I'd like to include the line number of the echo statement that pipes into $LOGGER:

MYPID=$$
MYNAME=`basename $0`
LOGGER="/usr/bin/logger -t $MYNAME[$MYPID]($LINENO) -p daemon.error"
...
echo 'this is an entry into the log file' | $LOGGER

The problem is, $LINENO expands on the "LOGGER" line, and not the "echo" line. I know I could do a function and pass $LINENO to it every time I want to log, I can also escape the parens and call `eval $LOGGER` on every line.

Is there a tight way to do it with a pipe into a single variable, by delaying expansion of the $LINENO var until the echo pipes into $LOGGER?

Thanks!

LOGGER="/usr/bin/logger -t $MYNAME[$MYPID](\$LINENO) -p daemon.error"

Thanks cfajohnson, but that back slash prevents LINENO from ever being expanded:

joe@rose:~$ MYNAME=joe
joe@rose:~$ MYPID=$$
joe@rose:~$ LOGGER="/usr/bin/logger -t $MYNAME[$MYPID](\$LINENO) -p daemon.error"
joe@rose:~$ echo 'test' | $LOGGER
joe@rose:~$ tail -1 /var/log/daemon.log
Feb 18 01:40:27 rose joe[26479]($LINENO): test

Am I missing something?

LOGGER="/usr/bin/logger -t $MYNAME[$MYPID]\(\$LINENO\) -p daemon.error"
echo test | eval "$LOGGER"