我设置了extglob
,未设置dotglob
。>>
[.*
也会产生.
和..
,与mv
或cp
结合使用非常邪恶。
[我玩了一会儿,发现*(?(.)+([^.]))
和$(ls -A)
给出了理想的结果,但我认为应该有一种更简单的方法...
编辑:对不起,我应该提到我正在寻找要在提示符下而不是脚本内使用的表达式。
我设置了extglob,未设置dotglob。 。*也会产生。和..与mv或cp结合使用时非常邪恶。我玩了一下,发现*(?(。)+([^。]))和$(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