Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Glob known subpaths

I am not sure of the name of this feature, but I want to use a glob to limit a path to two known branches.

ls /my/path/to/here/
ls /my/path/to/orhere/

I vaguely remember the syntax being something like the following;

ls /my/path/to/[here,orhere]/

That syntax doesn’t seem to work. The use of ls and path is for example only.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Are you looking for something like this?

ls /my/path/to/{here, orhere}

It’s called brace expansion: https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading