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

What's wrong with this glob pattern?

My interactive shell is zsh. In my home directory, I have the files

.zshrc .zshrc.mbook .sh_once .bashrc

and a few subdirectories, some of them also starting with a dot.

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

With the command

echo .*sh*c*[cke](.)

executed in my HOME, I expected to see the 4 aforementioned files, but it only returns .sh_once .zshrc.mbook. Why?

>Solution :

You are asking for filenames that contain a c and then end in c, k or e. The c in the middle and at the end cannot be the same. .zshrc and .bashrc have only the one c at the end, and therefore don’t match.

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