I have extglob
设置和dotglob
unset.
.*
也产生.
and ..
,这通常是不希望的mv
or cp
,所以我不希望包含这些。
我玩了一下发现*(?(.)+([^.]))
and $(ls -A)
给出想要的结果,但我认为应该有一个更简单的方法......
我正在寻找一种在提示符下使用的模式,而不是在脚本中使用。
unset GLOBIGNORE # empty-by-default, but let's make sure
shopt -s dotglob # disable special handling for "hidden" files
# ...and with the above items both done:
files=( * ) # just an example use of a glob
...设置数组files
包含当前目录中的所有对象,除了.
and ..
;任何其他用途*
也会有类似的行为。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)