mercredi 10 décembre 2014

command "jobs" cannot see the stopped jobs


I have wrote a very simple shell script to practice command "bg" , "fg" and "jobs":



#!/bin/bash

myvar=1
while [ $myvar -le 100000000 ]
do
echo $myvar
myvar=$(( $myvar + 1 ))
done


I use SecureCRT to connect a ubuntu machine.I have cloned several tab which is connected to this machne.


When I get the process pid and use kill -19 pid to suspend it , and I run jobs to see if it has become a background job, yes it is:



imcas@ubuntu:/home/wuchang$ jobs
[1]+ Stopped bash testShell


but what is strange is ,when I run command jobs in another tab of SecureCRT,I cannot see the stopped job:



imcas@ubuntu:/$ jobs
imcas@ubuntu:/$ jobs
imcas@ubuntu:/$


Anyone can explain this for me?



Aucun commentaire:

Enregistrer un commentaire