Question: please write the code with Python The shell environment variable $PATH contains a delimiter-separated sequence of directory paths (the delimiter varies between platforms). The shell

please write the code with Python please write the code with Python The shell environment variable $PATH contains

The shell environment variable $PATH contains a delimiter-separated sequence of directory paths (the delimiter varies between platforms). The shell uses the content of this variable to determine where to look for executables that correspond to commands entered at the command line. You can view this on Linux using the command: echo $PATH (using Windows CMD it's: echo $PATH?). Write a function named decompose_path() that takes a single string argument, named path. path will contain the contents of the PATH environment variable as returned by the echo $PATH command. Use a regular expression to create a list of each directory in PATH. The function should return that list. For example: path = "/usr/openwin/bin:/usr/ucb:/usr/bin:/bin:/etc:/usr/local/bin:/us r/local/lib:/usr/shareware/bin:/usr/shareware/lib: ." returns = ["/usr/openwin/bin", /usr/ucb", "/usr/bin", "/bin", "/etc", "/usr/local/bin", "/usr/local/lib", "/usr/shareware/bin", "/usr/shareware/lib", "."]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!