Small Mosaic


Categories:

/books
/career
/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:

July 20101
June 20104
May 20102
April 20101
March 20108
February 20101
January 20102
October 20092
September 200910
August 200910
July 20094
June 20091
April 20093
March 20097
February 20094
January 200917
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 codinghorrors events geekstuff justdont magazines meta misctech movies nottech operatingsystems/linux operatingsystems/linux/debian operatingsystems/solaris perl presentations programming python ruby security security/apache security/tools serversmells services/dns sites sysadmin testing tools/commandline tools/firefox tools/gui tools/network tools/online tools/online/greasemonkey tools/puppet unixdaemon

Copyright © 2000-2010 Dean Wilson XML feed logo