bash brace expansion for less typing
Named a file wrong? Need to move it to another directory? No big deal. What if you named a view file foo.haml instead of the proper foo.html.haml?
mv app/views/widgets/foo.{haml,html.haml}
Does exactly what you think it does. It expands to:
mv app/views/widgets/foo.haml app/views/widgets/foo.html.haml
Since it's just bash, it also works with git:
git mv app/views/widgets/foo.{haml,html.haml}
Works within the path too:
git mv app/views/{widget,whatsit}/foo.html.haml
Written by Daniel Huckstep
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#