I have a script:
runner.sh
#!/bin/bash
DIR="$(cd "$(dirname "$0")" && pwd)"
node --trace-warnings "$DIR/../engine/runner/Runner.js" "$@"
that I call that way:
./runner.sh --program --name=simple &
With or without &
at the end of line. I'd like to detect that in runner.sh
so I can run node
in background or regular way.
How can we detect (in bash script) that script is running in background?