how to continue run script after tail -f command

Viewed 3217

I have the following script:

tail -f nohup.out
echo 5

When I press Ctrl+C on tail -f, the script stops running: the 5 is not printed. How can I run the command echo 5 after I stop the tail command?

6 Answers

In bash end the line with a single ampersand to run the command in the background in an async way

tail -f nohup.out &
Related