Search code examples
bashshellcommandjobs

Command "jobs" doesnt work on terminal (shell,bash)


I'm just trying to make a simple script which involves the command "jobs", but it doesnt seem to work, it doesn't even get recogniced by "man"... No idea what's going on :S.


Solution

  • jobs will only report on background and/or suspended processes that were spawned by the instance of the shell in which jobs is being run. So using it in a script will be of limited usefulness (but should be fine for just reporting what's going on to the script user), as only things that were spawned earlier in the script and either backgrounded or suspended in some other way will be known to the shell instance running the script.