Skip to content

Latest commit

 

History

History
13 lines (7 loc) · 525 Bytes

make-array-files-pattern.md

File metadata and controls

13 lines (7 loc) · 525 Bytes

Make an array of files from glob pattern

myarr=(~/somedir/*)

Combine with shopt -s nullglob to handle no matching files. Reference the bash manual, which says:

If set, Bash allows filename patterns which match no files to expand to a null string, rather than themselves.

See this stack overflow post.