Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Any bash gurus know how to turn the commands below into a one liner?

trutch:$ touch app/views/pages/_sponsors.html.erb
trutch:$ touch app/views/pages/_donations.html.erb
trutch:$ touch app/views/pages/_volunteers.html.erb

I would like to be able to do something like this:

trutch:$ touch app/views/pages/[ARRAY].html.erb

If you have any sources for bash tricks such as this it would be appreciated as well.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Simple bash lists can be used for this:

touch app/views/pages/_{sponsors,donations,volunteers}.html.erb

Have a look at Bash One-Liners for tips, but the man page is also pretty detailed.

share|improve this answer
    
Thank you very much. Also, thanks for the very kind RTFM :) –  Tyler Rutschman Feb 18 '12 at 16:59

Maybe you want this:

touch app/views/pages/{_sponsors,_donations,_volunteers}.html.erb
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.