Set up environment checking and file piping