previous | start | next

The fg and bg Builtin Commands

Have the builtin_cmd function call a separate function to execute either of these commands:

void do_bgfg(char **argv)
     

(The provided version just returns; you must implement it.)

This function should check that the command uses proper syntax. E.g,:

For example if the jobs command lists jobs:

tsh> jobs
[1] (10686) Running myspin 40 &
[2] (10687) Running myspin 50 &
[3] (10688) Stopped myspin 60
        
     
        fg 10687     (make background process with process id 10687 be
                     the foreground process)

or

        fg %2       (make job 2 be the foreground process)

        bg %3       (start job 3 running, but still in background)

     


previous | start | next