Monday, May 5, 2008

Shell, Brace expansion

I found that I research this whenever I think of this function.
If I have to select file a,b,c only in /tmp, brace expansion is the answer. /tmp may have bunch of other files. Also repeating /tmp/a, /tmp/b, /tmp/c is annoying.

$ ls /tmp/{a,b,c}

Brace expansion is not used often, but when it is needed, it is super useful. I have to leave this note hoping that I have a place to lookup at least.

No comments: