Score:0

Running multiple scripts with piped input/output

us flag

I wish to call multiple scripts from a single script file, with various inputs and outputs like this:

./file1.sh ip1 ip2 op1

./file2.sh op1 op2

and so on. What I mean is that the output given by running file1 should be input to file2, and file2's output to file3 and so on. There are five files and they are to be called in a sequence. How can I write this?

Liso avatar
sd flag
You can pipe output to another script.
Score:0
cn flag

With the "pipe" symbol, i.e., | you can send the output of one command to the next command as in

command1 | command2 | command3

At a more advanced level, linux also has "named pipes".

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.