私は今かなり混乱しています。
pexpectの ドキュメントには、次のように記載されています。
Remember that Pexpect does NOT interpret shell meta characters such as
redirect, pipe, or wild cards (>, |, or *). This is a common mistake.
If you want to run a command and pipe it through another command then
you must also start a shell. For example::
child = pexpect.spawn('/bin/bash -c "ls -l | grep LOG > log_list.txt"')
child.expect(pexpect.EOF)
しかし、私はとを使用するいくつかの古いコードを見て|
い*
ますpexpect.sendline(some command | grep 'something')
。そこで、これらのコマンドのテストを開始しましたが、すべて機能しているようです。また、変更されたpexpectモジュールを使用していないことにも言及する価値があります。これは、Python用の単純な古いpexpectです。
どうして?明らかに機能するのに、なぜpexpectはメタ文字が機能しないと言及するのですか?