refactoring tests to use platform specific pipe commands and output