2009-09-08

Brackets in bash

Was just having a problem with a command which worked in the Z shell not working in bash and had to brush up on my knowledge of the difference between different types of brackets. Found a very useful article which explains it all.

I was trying to use braces to group commands but have them execute in the current shell. Z shell liked it but bash didn't. The solution to my problem was to put whitespace around the braces and to terminate the last command with a semicolon before the closing brace. Apparently this stuff is required in bash for "historical reasons".

No comments:

Post a comment