Unable to use Checkjobs and Autocd in Bash 4

Unable to use Checkjobs and Autocd in Bash 4

温柔少女心 发布于 2021-11-27 字数 671 浏览 799 回复 1 原文

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?

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

财迷小姐 2022-06-07 1 楼

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.