1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Cerrena [4.2K]
4 years ago
13

1. Write a shell script, renumber.sh, that will rename all the files in a directory. The first argument is a base name, second a

rgument is a file extension. If the script is run as: $ renumber.sh 25thAnniversary jpeg then the resulting files should have names like: 25thAnniversary001.jpeg, 25thAnniversary002.jpeg, 25thAnniversary003.jpeg, etc. Before renaming a file, make sure that a file with the new name does not already exist. If one does, handle the exception appropriately.
Computers and Technology
1 answer:
Scilla [17]4 years ago
6 0

Answer:

#!/bin/bash

if [ -z "$1" ] || [ -z "$2" ]

then

echo "invalid arguments"

exit 1

fi

filename="$1"

extension="$2"

cnt=1

for file in *. $extension

do

echo "renaming $file to $filename $cnt.$extension"

mv -i "$file" "$filename$cnt. $extension" #prompt before overwriting a file

cnt=$(( $cnt + 1 ))

done

Explanation:

You might be interested in
So, I am homeschooled, and I want to watch videos on my school account because I might be waiting for like emails from my teache
Jobisdone [24]

what web browser

if firefox go to addons and see if you can turn off mkaffee or something like that

or go incogneto

plese give me branliest good luck

3 0
3 years ago
Read 2 more answers
What feature does google docs have to allow users to work in a document?​
Pavel [41]

Answer:

Share.

Explanation:

Go to the Share button in the top right corner of the doc, and click it. Then type the email adress of who you want to work on it. (make sure the symbol to the right of the email is a little pencil Icon)

6 0
3 years ago
Which of these is the function of a modeler?
Liono4ka [1.6K]

Answer:

Create 3D assets from sketches

Explanation:

A modeler Job is to model all of the 3D/2D assets needed to obtain the final result wanted by the developers. The modeler creates the assets from sketches or images provided to him according to the theme.

5 0
3 years ago
Read 2 more answers
Why would a virtual machine be useful in a school? It provides a completely secure connection to the internet. Students can coll
Stels [109]
They can learn more and also it’s faster
5 0
3 years ago
How do you whitelist or turn off ad blocker for brainly?
sweet-ann [11.9K]

Answer:

rightclick and it should give you the option

Explanation:

sddas

6 0
3 years ago
Read 2 more answers
Other questions:
  • With a(n) ____, you can enter a value either by typing the value or by selecting it from a list.
    14·1 answer
  • A set of instructions to increase a programmer’s pay rate by 10 percent is hidden inside an authorized program. It changes and u
    6·1 answer
  • Point mode allows you to select cells for use in a formula by using your finger or the pointer
    7·1 answer
  • ____________________ memory is the ability to add RAM without shutting down the computer or operating system.
    13·1 answer
  • The keys in the computer's keyboard are represented by a numeric code agreement (ASCII). For example A is 65 and a is 97.
    12·1 answer
  • After you identify and subdivide all of the data elements for a database, you should group them by the entities with which they’
    10·1 answer
  • A query can have many Highly Meets results. True or False
    5·2 answers
  • Is brainly bugging out rn? <br> The site isnt like loading completely
    5·1 answer
  • If you were creating a program that would convert Fahrenheit to Celsius, which kind of variable would you want to use? a string
    7·2 answers
  • Given a sorted list of integers, output the middle integer. assume the number of integers is always odd.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!