`watch jobs` does not work on linux

I want to use watch jobs to see an updated display of all the jobs that I have running, but when I try to do this, all I get is the clock title and a blank screen. But using a script

 while (1) sleep 10; clear; jobs; end 

works, where is the problem?

+6
linux csh
source share
2 answers

Job management is controlled by the shell, and jobs is a shell built-in function. If you use the which jobs command, you will see that there are no binary named jobs in your $ PATH.

watch makes a system call every two seconds, so shell functions are not available.

You can also try watch 'ps awwwux | grep yourusername' watch 'ps awwwux | grep yourusername' . But this is not exactly the same as jobs .

+4
source share

The task is not a system command of his shell team - when you start to look, he performs a subshell, which has its own work control and, of course, no tasks. Try watching ps.

+3
source share

All Articles