Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(trycmd): Support echo text | command #344

Closed
wants to merge 1 commit into from

Conversation

chrysn
Copy link

@chrysn chrysn commented Jun 14, 2024

$ echo "hello" "second argument" | lines-from-stdin=1 bin-fixture
read line from stdin: hello second argument

Rather than attempting to do the common case and facing its security implications, this uses the fact that echo is defined in POSIX with a very small feature set, and that piping is a simple shell feature. The presence of the echo command is recognized (as any shell might recognize it) and evaluated into stdin data.

Closes: #172 (thus CC'ing @jpmckinney)

[edit: Add POSIX link]

@chrysn chrysn force-pushed the echo-int-trycmd branch 2 times, most recently from c9bf8cd to eb1af6f Compare June 14, 2024 11:27
@chrysn chrysn force-pushed the echo-int-trycmd branch from eb1af6f to bf1d020 Compare June 14, 2024 11:31
@chrysn
Copy link
Author

chrysn commented Jun 14, 2024

A test is included. In the project I'm using it in, switching from the published to the git version correctly shows that my README.md (which was ignored so far) is subtly lying, which is factually the correct result.

@epage
Copy link
Contributor

epage commented Jun 14, 2024

Thank you for your interest in this! However, I feel it is premature to have a PR for this as we have not decided on a solution and solution discussions I feel are best left to issues. I have also found the existence of PRs are manipulative of maintainers, whether intended by the author or not, as maintainers want to honor the work that was done by people and work to merge it. Some maintainers recognize that and learn to not care at all. For myself, I've taken a fairly hard stance that I push back and close PRs.

@epage epage closed this Jun 14, 2024
@chrysn
Copy link
Author

chrysn commented Jun 14, 2024

No pressure intended, happy to move the discussion back to #172. With the issue split out from #168, this sounded to me like the discussion was already complete by isolating the topic from command execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Piping from echo to provide standard input
2 participants