12 # write to file sh myscript > out.txt # append to file sh myscript >> out.txt # write both output and stderr to file sh myscript 2&1>> out.txt — 上午。 source