Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Bash Brace Expansion

In our static assets directory, we have the following directories:


We want to namespace our application (my_app). We could type the following:

   mkdir public/images/my_app
   mkdir public/javascripts/my_app
   mkdir public/stylesheets/my_app

Or to save time, we could type:

   mkdir public/{images,javascripts,stylesheets}/my_app

This will create the three directories with one command.

For more information on bash curly brace expansion, checkout this article by Mitch Frazier on Linux Journal.

Another expansion I’ve used:

   cp file.txt{,.bak}
      cp file.txt file.txt.bak
Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *

Share This