I can probably fix the lines to instead call the command to pipe the file contents rather than reading, storing in a variable and passing to stdin