piping output of tail running in background

Not sure why this does not work in bash:
tail -f err.log |&
-bash: syntax error near unexpected token `&'

I am attempting to continuously read a file that is being updated by doing a "tail -f" on the file and piping the output to stdin which can then be read by the next shell command

Thnx

Hi,
What's sort of next unix command do you want to apply on the continious tail ?

What you are trying is co-processing and not piping.

piping would be something like this:

ls -l | pg

In the above example output of the ls -l command is piped to pg, which will display the output in page break ups.

refer to this thread

Thanks for the replies. Excuse my using wrong terminology - yes i was attempting a coprocess by "tailing" a log file and have its stdout be read by a read in the current script - something like this...

tail -f $LOGFILE |&
while read -p line

I found my problem was with the shell that i was using. It does not work in the bash shell but does work in ksh.

tail -f $LOGFILE | \
while read -p line
...

or

tail -f $LOGFILE | while read -p line
...