Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

=+a) Find the expected number of appearance defects in a new car.

Answered: 1 week ago