Closed naksyl closed 10 months ago
The shell now has (non-standard) options to control how the hidden and system attributes affect globbing:
nohiddenglob
excludes files with the hidden attribute from globbingnohidsysglob
excludes files with both the hidden and system attributesNote:
nohiddenglob
takes precedence.An example of the use of the new options (plus the existing nocaseglob
):
~ $ set -o nocaseglob
~ $ lsattr nt*
------h-a-n NTUSER.DAT
------hsa-- NTUSER.DAT{53b39e88-18c4-11ea-a811-000d3aa4692b}.TM.blf
------hsa-- NTUSER.DAT{53b39e88-18c4-11ea-a811-000d3aa4692b}.TMContainer00000000000000000001.regtrans-ms
------hsa-- NTUSER.DAT{53b39e88-18c4-11ea-a811-000d3aa4692b}.TMContainer00000000000000000002.regtrans-ms
------hsa-- ntuser.dat.LOG1
------hsa-- ntuser.dat.LOG2
------hs--- ntuser.ini
~ $ set -o nohidsysglob
~ $ lsattr nt*
------h-a-n NTUSER.DAT
~ $ set -o nohiddenglob
~ $ lsattr nt*
lsattr: can't stat 'nt*': No such file or directory
~ $
The options also affect tab completion.
Nice surprise.
Recent release add support for hiding files with
system
attribute (ls -AA
). This reminds me that globbing show files withhidden
attribute wich I belive shoud be treated as Unix dotfiles (ls does not show them)