BASH 셸 리디렉션의 많은 용도를 보여주는 좋은 치트 시트가 있습니까? 나는 내 학생들에게 그런 것을주고 싶다. 내가 좋아하는 것 몇 가지 예 덮여 볼 수 있습니다 :bash 셸 stdout/stderr 리디렉션 동작을 나타내는 치트 시트
이cmd > output_file.txt #redirect stdout to output_file.txt
cmd 2> output_file.txt #redirect stderr to output_file.txt
cmd >& outpout_file.txt #redirect both stderr and stdout to output_file.txt
cmd1 | cmd2 #pipe cmd1 stdout to cmd2's stdin
cmd1 2>&1 | cmd2 #pipe cmd1 stdout and stderr to cmd2's stdin
cmd1 | tee result.txt #print cmd1's stdout to screen and also write to result.txt
cmd1 2>&1 | tee result.txt #print stdout,stderr to screen while writing to result.txt
(또는 우리가이 사회의 위키를 만들고 여기에 그런 것들을 열거 할 수있다)
감사합니다!
setjmp는
무슨 잘못? 그냥 인쇄 해! hehe. –
치트 시트는 아니지만 여기에는 훌륭한 토론이 있습니다 (http://mywiki.wooledge.org/BashGuide/InputAndOutput). –