Dec-13-2017, 04:51 AM
shells like bash can take a particular syntax and understand a series of commands to be put into a pipeline, when such a command string with that syntax is given to it. it makes a number of system calls to construct that pipeline, including the 2 you showed, many times. what i am looking for, is code in Python that carries out a similar setup, execution, and completion. i am not looking for a few example syscalls. i am looking for how Python coders would carry out those steps. part of the reason is to see what Python library functions might get used, how they would be used, and how they fit into the steps. i am less interested in how a command pipeline string would parsed. you could just assumed the commands to be pipelined are in a list ... a list of commands ... a list of lists of strings (a list of lists of parsed command tokens). this could be defined as a function
run_pipeline(list_of_lists_of tokens):
. fyi, like so many things, i've done this, before, in C.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.