Question: Write a Python3 program in an UNIX system environment where the program will; 1. Locate every file in a directory that has a six number

Write a Python3 program in an UNIX system environment where the program will;

1. Locate every file in a directory that has a six number numerical ID in its name (e.g 432244_test.)

2. Isolate the ID of each file inside the directory. Files in directory will be formatted as _test_.

3. Change the name of every file inside to be _testFunction.

4. For each file with an ID change the permissions so that its executable

5. Print the contents of each file to the screen

Step by Step Solution

3.48 Rating (148 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Below is a Python script that fulfills the requirements using the os and re modules to handle file o... View full answer

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 Operating System Questions!