Bash: Put a job in the background and then tail the log

Solution 1:

Just drop the semicolon:

# foo param1 param2 >> run.out & tail -f run.out

Solution 2:

You need to put the backgrounded command in ()'s.

(ls -R / >>/tmp/list & ); tail -f /tmp/list

Sadly, this really backgrounds it. You won't be able to us %1 to get to its PID.