#include <unistd.h>
int main(int argc, char* argv[])
{
char buf[500];
read(0, buf, 5);
return 0;
}
stdin
から上記read
5つの文字、私は5
より入力場合:このような動作は標準で定義されていますか?
12345morethan5
[[email protected] test]# morethan5
-bash: morethan5: command not found
残りの文字は、シェルコマンドとして実行されます。
このような動作は標準で定義されていますか?あなたのプログラムは、5つの文字を読み込み、それはそれだ:-)
の
このセクションの3.3.2は、http: /www.aosabook.org/ja/bash.html – Joe