Search code examples
bashbash4

Unable to use Checkjobs and Autocd in Bash 4


There are new options in Bash 4: checkjobs and autocd. However, I did not find documentation for them at

man bash

I run unsuccessfully

{checkjobs,autocd}

I found the following in release notes

 There is a new `checkjobs` option that causes the shell to check for and
 report any running or stopped jobs at exit

and

There is a new `autocd` option that, when enabled, causes bash to attempt
to `cd` to a directory name that is supplied as the first word of a
simple command.

How can you use autocd and checkjobs?


Solution

  • autocd and checkjobs are not commands, but rather, they are options.

    They can be set by using the shopt built-in.

    Example:

    shopt -s autocd
    

    and

    shopt -s checkjobs
    

    or

    shopt -s autocd checkjobs
    

    to set both.