On 06/04/2020 18:35, Istvan Gabor wrote:
On Mon, 6 Apr 2020 17:19:58 -0400, Anton Aylward wrote:
On 06/04/2020 07:18, Istvan Gabor wrote:
Hello:
I have a program that can send its output to a script.
Now that's an ambiguous phrasing if ever I met one!
Looking it at again, I guess you're right. That's because I did know what terms to use to describe it. I could have written my example like this:
Program calls myscript.sh -option -option
What program? Direct from the command line or what? Embeded in another script?
An myscript.sh runs as:
myscript.sh -option -option <the-data-provided-by-the-program>
Is this the 'program' mentioned above? What is thiss data on the command line? Is it quoted? How? Why not supply it to the STDIN? via a pipeline?
As an old UNIX hacker the idea of a set of pipes&filters is natural enough ... find ... -print0 | xargs -0 ... | grep <parameters> | awk '{format ..}' comes naturally. But the kernel support for that as copocesses doesn't exist in MS-DOS or VMS even if the CLI permits that syntax.
I even can't guess what the above is about.
OMG! But pipes are so fundamental to UNIX/Linux; they are what makes it so different from all that went before! (There's even a white book on them!) Coprocessing, the parent/child fork model rather than the 'transient program area' model, is another thing that made UNIX distinct. That you can write those sort of scripts at all is an emergent property off this.
Is that what is meant by "can send its output"?
No. What I meant was that the program sends/provides data (output) to the script it calls.
You are ambiguous again. There are a couple of ways that a program can send (backwards) to its parent. Which is the literal interpretation if your above sentence. It would mean that you script has a line with something like ... $(program ...) somewhere in it. If that's NOT the case, then you had better try again describing what's going on. It may be simpler to just show us this script.
The script should work with that data. That is the program's output is "piped" to the script's input.
The Pipe is a mechanism that lets you use two or more commands such that output of one command serves as input to the next. In short, the output of each process directly as input to the next one like a pipeline. Please read the shell man page which describes this and coprocesses and redirection along with some examples. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org