Terminating a shell script bar from a script foo

Viewed 29

I have a script foo which, if provided an argument start, starts, among other things a script bar in the background and exits - bar contains an infinite loop.

At a later stage, I want to call foo with argument stop and I would like that script bar, which still runs in the background stops running.

What is the text book way of achieving this?

2 Answers
Related