I want to use an environment variable in a command with recursive search.
export RAILS_FILE_EXTENSIONS='(erb|feature|haml|jrxml|js|rake|rb|rxml|scss|xml|yml)'
ls **/*.${RAILS_FILE_EXTENSIONS}
It does not work this way. How should it look like?
I want to use an environment variable in a command with recursive search.
export RAILS_FILE_EXTENSIONS='(erb|feature|haml|jrxml|js|rake|rb|rxml|scss|xml|yml)'
ls **/*.${RAILS_FILE_EXTENSIONS}
It does not work this way. How should it look like?
Tell zsh to interpret RAILS_FILE_EXTENSIONS
as a pattern rather than a raw string when substituting its value, with the ~
parameter expansion flag.
RAILS_FILE_EXTENSIONS='(erb|feature|haml|jrxml|js|rake|rb|rxml|scss|xml|yml)'
ls **/*.$~RAILS_FILE_EXTENSIONS