refactoring tests to use platform specific pipe commands for linux, darwin and windows