Im trying to run some pipe in a with-exec, like that container | from alpine | with-exec "cat /etc/passwd | grep a" but got an error process "cat /etc/passwd | grep a" did not complete successfully: exit code: 1
Is there a way to do it (or alternative solution?)
I did try it with php sdk to, and played with redirectStdout/redirectStdin but I want to have a solution that does not create tmp file.
// Same error as above
->withExec(['cat', '/path/to/a/file', '|', 'grep', 'bar'])
// This work but create a tmp file
->withExec(
['cat', '/path/to/a/file'],
redirectStdout: '/tmp/foo',
)
->withExec(
['grep', 'bar'],
redirectStdin: '/tmp/foo',
)
Does anyone have a clue? 🙏