-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add exec/2: posix_spawn #3133
Open
CosmicToast
wants to merge
11
commits into
jqlang:master
Choose a base branch
from
CosmicToast:posix_spawn
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add exec/2: posix_spawn #3133
Commits on Jun 25, 2024
-
This is an initial MVP with quite a few things still missing (such as: better error messages, documentation, tests). Despite this, it is already feature-complete on POSIX platforms (on Windows it currently reports an "unsupported on this platform" error). The signature is `anything | exec(path; [args…])`. `path` and all `args` must be strings. `anything` will be converted to a string if it isn't a string in memory, then piped into the process' stdin. The output is all stdout of the process. The exit code is not reported. Technically, "path" can be a simple name and `$PATH` will be searched. This is because the underlying function is `posix_spawnp`. This can bec hanged easily. The process does not have access to environment variables. This can be changed as well. Piping between programs works. Here's an example to try it out: `tostring | exec("seq"; [.]) | exec("wc"; "-l")` Expected output when inputting numbers is that number, but it notably goes through seq, then line-counting.
Configuration menu - View commit details
-
Copy full SHA for ce84ba7 - Browse repository at this point
Copy the full SHA ce84ba7View commit details -
Configuration menu - View commit details
-
Copy full SHA for a4c197a - Browse repository at this point
Copy the full SHA a4c197aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0a3848a - Browse repository at this point
Copy the full SHA 0a3848aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 648e772 - Browse repository at this point
Copy the full SHA 648e772View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d8c020 - Browse repository at this point
Copy the full SHA 7d8c020View commit details -
Configuration menu - View commit details
-
Copy full SHA for 000f24f - Browse repository at this point
Copy the full SHA 000f24fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d3f3cd - Browse repository at this point
Copy the full SHA 5d3f3cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for a359afe - Browse repository at this point
Copy the full SHA a359afeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 51a620c - Browse repository at this point
Copy the full SHA 51a620cView commit details -
Configuration menu - View commit details
-
Copy full SHA for cabd52d - Browse repository at this point
Copy the full SHA cabd52dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 17a2198 - Browse repository at this point
Copy the full SHA 17a2198View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.