Small Mosaic


Categories:

/books
/career
/cloud
/codinghorrors
/events
/geekstuff
/justdont
/languages
/languages/bash
/linkshot
/magazines
/meta
/misctech
/movies
/nottech
/operatingsystems
/operatingsystems/linux
/operatingsystems/linux/debian
/operatingsystems/solaris
/perl
/presentations
/programming
/python
/ruby
/security
/security/apache
/security/tools
/serversmells
/services
/services/dns
/sites
/specifications
/sysadmin
/testing
/tools
/tools/commandline
/tools/firefox
/tools/gui
/tools/network
/tools/online
/tools/online/greasemonkey
/tools/puppet
/unixdaemon

Archives:

May 20131
April 20131
March 20131
February 20133
January 20135
July 20111
June 20112
May 20113
April 20112
March 20117
January 20111
Full Archives

Tue, 08 Jan 2008

Bash Puzzles - Brace Expansion
There is nothing like other peoples code to highlight all those little gaps in your knowledge of a programming language. I know what the first one does:


$ mkdir -p {projectone_,projecttwo_,projectthree_}log

$ ls -1
projectone_log
projectthree_log
projecttwo_log

And I was a confident (and a little bit happy) about knowing what the second one does:


$ mkdir -p {project_one,}log

$ ls -1
log
project_onelog

But I had no clue about this one. And my guess (that it would be treated as a single element and expand to 'projectone_log') was very wrong:


$ mkdir -p {projectone_}log

Like this post? - Digg Me! | Add to del.icio.us! | reddit this!

Posted: 2008/01/08 21:34 | /languages/bash | Permanent link to this entry | This entry and same date


books career cloud codinghorrors events geekstuff justdont magazines meta misctech movies nottech operatingsystems/linux operatingsystems/linux/debian operatingsystems/solaris perl programming python ruby security security/tools serversmells services/dns sites sysadmin testing tools tools/commandline tools/firefox tools/gui tools/network tools/online tools/online/greasemonkey tools/puppet unixdaemon

Copyright © 2000-2010 Dean Wilson XML feed logo