Can several inputs be connected to one program?

I have a C program that takes 2 separate inputs via a read function (0, buffer, size (buffer)). They take two different entrances. Is it possible, with just bash command, to plug two pytho -c or perl -e scripts into a C program? Or do I need to change the source code? thanks in advance

+3


source to share


1 answer


You can use a group of commands

{
   echo "First command"
   echo "Second command"
} | nl

      



Or in one line for easy interactive editing:

{ echo "First"; echo "Second"; } | nl

      

+9


source







All Articles