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

今天遇上一个忧桑的问题。配置完编译环境,发现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
之后再去试试吧。
  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值