Python Forum
builing a long variable-length command-pipeline
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
builing a long variable-length command-pipeline
#5
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.
Reply


Messages In This Thread
RE: builing a long variable-length command-pipeline - by Skaperen - Dec-13-2017, 04:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to write a part of powershell command as a variable? ilknurg 2 1,237 Jul-26-2022, 11:31 AM
Last Post: ilknurg
  Os command output in variable shows wrong value paulo79 2 1,645 Apr-09-2022, 03:48 PM
Last Post: ndc85430
  How to use a variable in linux command in python code? ilknurg 2 1,720 Mar-14-2022, 07:21 AM
Last Post: ndc85430
  Command output to Variable ironclaw 1 1,876 Aug-26-2021, 06:55 PM
Last Post: bowlofred
  Correct syntax for a variable inside a quotes: MP4Box command JonnyDriller 2 2,909 Feb-02-2020, 01:22 AM
Last Post: JonnyDriller
  Long command with characters not working in Python on Oracle Linux 7 iaas_infra 10 6,530 Jul-19-2019, 04:53 PM
Last Post: ichabod801
  Insert a variable in a Python > Cellular AT command ElectronicsNut 1 2,240 Jul-07-2019, 02:26 PM
Last Post: joe_momma
  pipeline between 2 programs Skaperen 11 6,129 Jul-02-2018, 10:48 PM
Last Post: Skaperen
  search and store a value from linux command output in to variable python prazy29 1 3,396 Apr-06-2018, 01:56 PM
Last Post: wavic
  [subprocess]>Run a cmd command and get output into a variable CSA75 4 23,134 Mar-13-2017, 09:33 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020