You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to make an array of hidden files in bash (hidden as in the NTFS hidden flag, not preceding the a dot).
This doesn't work:
$ dir.exe /a:h /b "$dir"
dir: cannot access '/a:h': No such file or directory
dir: cannot access '/b': No such file or directory
This does work:
$ cmd.exe /C dir /a:h /b "$dir"
Default.rdp
desktop.ini
SideSync
But when I try using this in command substitution in bash...
for file in "$(cmd.exe /C dir /a:h /b "$dir")"; do STUFF; done
...it results in a series of errors that looks like this, as it's started in the directory where the script resides:
Cannot match pattern: '. ./src ./src/pathpicker ./S3 /mnt/c/Users/jason'
'\\wsl.localhost\WLinux\home\jason\.dotfiles\bin\scripts'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I need to make an array of hidden files in bash (hidden as in the NTFS hidden flag, not preceding the a dot).
This doesn't work:
This does work:
But when I try using this in command substitution in bash...
...it results in a series of errors that looks like this, as it's started in the directory where the script resides:
How can I make this work?
Beta Was this translation helpful? Give feedback.
All reactions