Suppose we have a command,
And we want to do something like this:
eval-some-language —-path=“say hello world! exit 3”
I think the following solution might work for one file, and if stdin is not used for sth else:
eval-some-language —-path=“/dev/stdin” <<<“say hello ...”
Does this work with all commands? How portable is it? (macOS?)
And is there any other ways to do this?
Update: Both my solution, the accepted answer, and zsh’s =() don’t work if the file needs to be executable. :(