read commands from STDIN if used as pipe