Make shell ouput redirect more portable