Write a script called ChangeExtensions that accepts two file name extensions as arguments, and renames all...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a script called ChangeExtensions that accepts two file name extensions as arguments, and renames all files with the first extension to have the second extension. For example, Change Extensions txt text would change all .txt files to be .text files. Hint: read the man pages for basename. The script must check that two arguments have been provided, and exit with an error message if not. The script must check if there are any files with the first extension, and exit with an error message if there are none. If all goes well, a message must be output for each filename that is changed. (1.0%) Write a script called ChangeExtensions that accepts two file name extensions as arguments, and renames all files with the first extension to have the second extension. For example, Change Extensions txt text would change all .txt files to be .text files. Hint: read the man pages for basename. The script must check that two arguments have been provided, and exit with an error message if not. The script must check if there are any files with the first extension, and exit with an error message if there are none. If all goes well, a message must be output for each filename that is changed. (1.0%)
Expert Answer:
Answer rating: 100% (QA)
Heres a script called ChangeExtensions that accepts two file name extensions as arguments and renames all files with the first extension to have the second extension It includes the checks for the number of arguments and the existence of files with the first extension bash binbash Check the number of arguments if ne 2 then echo Error Two arguments are required Usage ChangeExtensions oldextension newextension exit 1 fi Store the old and new extensions from the arguments oldextension1 newextension2 Check if there are any files with the old extension if ls oldextension 1 devnull 2 1 then echo Error No files found with the extension oldextension exit 1 fi Iterate over the files with the old extension and rename ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Determine the parity checkers output [see Figure 4-25(b)] for each of the following sets of data from the transmitter: Figure 4-25(b) (a) (b) (c) (d) D3 D2 1 1 D 0 1 1 1 0 P 0 1 1 1 1 1 1 10 0 0 Do 0...
-
Consider Lebesgue measure \(\lambda\) on the space \(([a, b], \mathscr{B}[a, b])\) and assume there on that \(f \in \mathcal{L}^{1}([a, b], \lambda)\) satisfies \(\int_{a}^{b} x^{n} f(x) d x=0\) for...
-
Refer to all of the facts in Problem 12-6. Required 1. Using the format in the chapters appendix, prepare a statement of cash flows work sheet. 2. Prepare a statement of cash flows for 2014 using the...
-
Reconsider Prob. 10-48. Using EES (or other) software, determine the optimum bleed pressure for the closed feedwater heater that maximizes the thermal efficiency of the cycle.
-
Which of the following best describes how each passage characterizes Hemingway? A) Passage 1 portrays him as a tortured poet, but Passage 2 portrays him as a crass amateur. B) Passage 1 portrays him...
-
A Sampling Distribution for Gender in the Rock and Roll Hall of Fame Exercise 3.37 tells us that 47 of the 303 inductees to the Rock and Roll Hall of Fame have been female or have included female...
-
Children's Hospital of the King's Daughter in Norfolk, Virginia, introduced a new budgeting method that allowed the hospital's annual plan to be updated for changes in operating plans. For example,...
-
The yellow hat is about benefits and feasibility. This is an optimistic but logical thought process. using Bestbuy as a company, who will benefit from their voluntary commitments ? Are the voluntary...
-
To complete a cash sale, you would use the following window: a. Enter Sales Receipt b. Write a Cheque c. Create an Invoice d. Pay Bills What is tracked in the Accounts Receivable account?
-
In the few years before the Eurozone crisis, the real effective exchange rates (REERs) of countries in southern Europe (such as Greece and Spain) relative to the German REER added to the problems...
-
What Financial Tools and Applications could we use to analyze Yelp Inc?
-
Go to the Nareit website and navigate to the REIT Data section of the website. Download an appropriate dataset and conduct a comparative analysis of REITs relative to equity investment. That is,...
-
FINC 560 M6 Discussion What is Capital Structure? https://www.youtube.com/watch?v=PFeKjX9Dt1s The video mentions debt covenants. Identify another debt covenant not suggested in the video, and state...
-
What Finance literature sources can i review when looking it mortgage finance and performance of commercial banks ?
-
High-Low Method for a Service Company Boston Railroad decided to use the high-low method and operating data from the past six months to estimate the fixed and variable components of transportation...
-
Find the volume of the described solid S. A frustum of a right circular cone with height h, lower base radius R, and top radius r -r- --R
-
Consider the wage equation, where WAGE is measured in dollars per hour, education and experience are in years, and \(M E T R O=1\) if the person lives in a metropolitan area. Use the data file cps 5...
-
In this exercise we explore the relationship between total household expenditures and expenditures on telephone services. Use the data file malawi_small (malawi has more observations). a. Using...
-
The data file \(b r 2\) contains data on 1080 houses sold in Baton Rouge, Louisiana, during mid-2005. We will be concerned with the selling price (PRICE), the size of the house in square feet (SQFT),...
Study smarter with the SolutionInn App