0
我有一個程序,但我沒有訪問代碼。該程序讀取stdin。一個典型的調用看起來是這樣的 -如何在沒有單獨文件的情況下爲程序提供stdin?
> ./.prog
> input-1: <I give input-1>
> input-2: <I give input-2>
.
.
.
> input-n: <I give input-n>
> output
我在做什麼,現在是把所有的爭論在一個名爲argsfile.in
文件,內容是這樣的 -
input-1
input-1
...
input-n
,並稱之爲 -
./prog < argsfile.in
我想做同樣的事情,而無需使用一個文件,這樣的事情 -
>./prog < "input-1" "input_2" ... "input-3"
我該怎麼辦呢?