Given a directory called Project1 with 500 files called rock000.py, rock001.py, ... , rock500.py, create a bash shell script that will rename all the files given in this directory. The script should take two arguments: a base name and a file extension. Please include the specifics from the example in the code (i.e., identify the base name, extension, and old and new file names and write them as part of the code). If we run bash project.sh project_rocks

LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
5th Edition
ISBN:9781337569798
Author:ECKERT
Publisher:ECKERT
Chapter7: Working With The Bash Shell
Section: Chapter Questions
Problem 6DE
icon
Related questions
Question

Given a directory called Project1 with 500 files called rock000.py, rock001.py, ... , rock500.py, create a bash shell script that will rename all the files given in this directory. The script should take two arguments: a base name and a file extension. Please include the specifics from the example in the code (i.e., identify the base name, extension, and old and new file names and write them as part of the code). If we run bash project.sh project_rocks py the resulting files in the directory should be like this: project_rocks000.py, project_rocks001.py, .. , project_rocks500.py. 

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:
9781337569798
Author:
ECKERT
Publisher:
CENGAGE L