作者Seamisai (Seamisai)
看板LinuxDev
標題[問題] shell 語法
時間Sat Jul 25 02:25:02 2009
在執行shell command
可以指定一輸入檔案
如 command < file1
如果想要指定兩個以上檔案
指令為??
似乎不是 command < file1 < file2
請問該怎麼做呢??
( 不想使用cat將檔案全都集中到file1 再 command < file1 )
謝謝
--
Se ami sai quando tutto finisce
Se ami sai come un brivido triste
Come in un film dalle scene già viste
Che se ne va, oh no!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.116.87.135
※ 編輯: Seamisai 來自: 140.116.87.135 (07/25 02:27)
1F:推 zwai:command < `cat file1 file2` 這樣咧? 07/25 14:16
2F:→ Seamisai:在bash: -bash: `cat file1 file2`: ambiguous redirect 07/25 15:33
3F:→ freesamael:試試 cat file1 file2 | command - 07/26 01:24
4F:→ Seamisai:謝謝樓上 方法可行 想請問最後的"-"代表的意思是? 07/26 15:38
5F:→ Seamisai:因為我加不加"-"都可完成這項指令 07/26 15:38
6F:推 jlovet:如果你的程式預設就是去讀stdin,那就不用加 07/29 13:08