The Friendly Coder

On software development and technology

BASH error handling

I have been spending a lot more time lately working in Linux environments, which has afforded me with an opportunity to learn more about the Bourne Again Shell and it’s scripting environment. One thing I found somewhat tedious and difficult to figure out was how to effectively do BASH error handling in shell scripts. I’ve summarized several gotchas I encountered as well as several patterns that seem to work quite well.

MSBuild Gotchas: Traversed Static Item Evaluation

If you know anything about MSBuild, you know that knowing the order of evaluation for properties, items and such is critical. But how does the order of evaluation work when chaining control to other scripts using the task (otherwise known as script traversal)? The answer may surprise you.

MSBuild: Visual Studio Intellisense

Visual Studio has shipped with built-in Intellisense support for MSBuild for several years, however anyone who has used either of the two commonly used add-on packs (the Community Tasks and the Extension Pack) has undoubtedly noticed that these custom tasks are not natively supported. Further, anyone who has gone digging will notice that these projects either explicitly do not support intellisense or simply do not make it obvious how to set it up. As such I have taken the liberty of doing the leg work needed to get these working and decided to make my findings public on todays post.


Batch File Gotcha: Question Mark Wildcard

Todays batch file gotcha applies equally well to DOS commands in general, but if you think you understand how basic wildcard substitution is performed you may want to read on about this subtle gotcha…

Batch File Gotchas: Command Blocks

When multiple DOS commands are to be executed together, say in a loop or in a conditional block, they are wrapped in round brackets. But this subtle gotcha has caused me many head-scratching sessions in front of my text editor…

MSBuild Gotchas: Task Batching

Look at the following two statements: <Message Text=”Value = ‘@(SourceFiles)”/> and <Message Text=”Value = ‘@(SourceFiles)” Condition=”%(SourceFiles.identity)!=””/>? If you don’t know why these two statements give different outputs then you need to read on.