Showing posts with label io. Show all posts
Showing posts with label io. Show all posts

Sunday, January 15, 2012

Bash Basics

I've been doing a lot of bash scripting lately.  I haven't really done any bash scripting since, oh, 2007 or so, and nothing to complicated even then, so it's been an interesting learning / remembering experience for me.  Hopefully writing it down this time will make it easier next time.  Here's a preview of what you'll find here:

  • Defining and using variables
  • Variable and arithmetic expansions
  • Arrays
  • If statements
  • While loops
  • For loops
  • Input redirection, output redirection, and pipes
  • Regex tools: grep, sed
  • Command substitution
  • Useful commands

Sunday, December 18, 2011

Redirect Console Output in C#

I've been writing some tools that will duplicate behavior that I get for free in Visual Studio's MSTest framework for MonoTouch. One of the last pieces of the puzzle was the fact that MSTest will log any output to the console as part of the test results XML file. However, it does it intelligently, so that the output for each test is saved with the test results, and any output that is emitted outside of a test goes to the console. So, how could I redirect console output temporarily?