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
Exec as argument of next Exec calls #160
Comments
It may help to know that you can use script.Exec("lsb_release -cs").ExecForEach("ls {{.}}").Stdout() |
Thank you, I missed that method. Can I also use it for the 3rd case? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Writing #159 I thought that it could be good to have a way to use the stdout of a command executed with
Exec
as parameter of a followingExec
call.For being even more useful, it could be possible to support several
Exec
calls.And to even go further (sorry, I'm blowing my mind), they could also be used as values to replace on a specific format string.
NOTE I'm not familiar with the
script
implementation, so I don't know if this is feasible, or if it's hard to implement or not.Let me write some example of an hypothetical API for each of the above wacky ideas.
Right now,
script
allows to do thisThis translate to the shell script
I'm exposing an example with shell script that I think that I cannot translate using
script
to a pipe execution as before; each numbered item relates, in the same order, to the three things that I exposed at the beginning of this issue.For keeping the examples concise, they are ilustrative examples rather than a specific use case that I'm having.
ls $(lsb_release -cs)
In
script
isn't currently possible without having to execute each of them speartelly. I'm going to show howscript
could offer it with some unexisting methods without stating if their names are good nor if it's a good idea to have them.Exec
is passed as an argument on the followingExec
call.Exec
calls.In this case I used
echo
inside of anExec
, but it could be extended to each source functions that receive a string as a parameter, hence it could be also done asThe text was updated successfully, but these errors were encountered: