加入收藏 | 设为首页 | 会员中心 | 我要投稿 莱芜站长网 (https://www.0634zz.com/)- 云连接、建站、智能边缘云、设备管理、大数据!
当前位置: 首页 > 综合聚焦 > Ubuntu > 正文

【环境配置】ubuntu中shell命令不能识别通配符的解决办法之一

发布时间:2020-09-22 01:37:38 所属栏目:Ubuntu 来源:互联网
导读:今天遇上一个忧桑的问题。配置完编译环境,发现shell脚本或者终端中无法识别通配符”*“,使用时提示如下错误信息: cannot access *: No such file or directory 如下为我使用的解决办法 ,记录下希望帮助到需要的人: 1、查看nullglob配置 运行shopt命令,

今天遇上一个忧桑的问题。配置完编译环境,发现shell脚本或者终端中无法识别通配符”*“,使用时提示如下错误信息:

cannot access *: No such file or directory

如下为我使用的解决办法 ,记录下希望帮助到需要的人:

1、查看nullglob配置

运行shopt命令,查看nullglob选型的配置,命令如下:

shopt
shopt的使用说明可以查阅如下页面的介绍: http://man.linuxde.net/shopt,如下为我不可用时的配置:
autocd          off
cdable_vars     off
cdspell         off
checkhash       off
checkjobs       off
checkwinsize    on
cmdhist         on
compat31        off
compat32        off
compat40        off
compat41        off
compat42        off
complete_fullquote      on
direxpand       off
dirspell        off
dotglob         off
execfail        off
expand_aliases  on
extdebug        off
extglob         on
extquote        on
failglob        off
force_fignore   on
globstar        off
globasciiranges off
gnu_errfmt      off
histappend      on
histreedit      off
histverify      off
hostcomplete    off
huponexit       off
interactive_comments    on
lastpipe        off
lithist         off
login_shell     on
mailwarn        off
no_empty_cmd_completion off
nocaseglob      off
nocasematch     off
nullglob        on
progcomp        on
promptvars      on
restricted_shell        off
shift_verbose   off
sourcepath      on
xpg_echo        off

可以看到nullglob选型当前时off状态。

2、激活nullglob选型

使用如下命令激活nullglob选型。

shopt -s nullglob
之后再去试试吧。

(编辑:莱芜站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读