Re: [問題] bash 的 redirect

看板Linux作者 (lloyd huang)時間16年前 (2010/01/31 12:24), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
※ 引述《kok45 (11)》之銘言: : 請問 : 我有一個 bash script : 我想把所有的 standard output 的 message 導到 一個 logfile 裡 : 我只知道在所有有 output 的地方 加上 >logfile : 這樣感覺很不方便 : 請問 可以怎麼做比較簡單? : ==================================== : 另外想問 : 如果我想同時 保持 standard output 的 message : 並且同時把 message 存到 logfile 裡 : 請問應該怎麼做?? : 感謝 lloyd@baby's bottle:$ cat test.sh #!/bin/bash ls -l / date #> ./test.sh > /tmp/log #> ./test.sh | tee /tmp/newlog -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.127.60.21

01/31 12:27, , 1F
對喔...........感謝你
01/31 12:27, 1F
文章代碼(AID): #1BPGN_1O (Linux)
討論串 (同標題文章)
文章代碼(AID): #1BPGN_1O (Linux)