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]
3 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]3 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
If I were to install python in kali linux on a Acer 11 Chromebook and C730 would I be able to hack python with it since I have n
Mazyrski [523]

Python isnt usually used for hacking because of it not being compiled and being slow etc. But with the correct code and training you should be able to hack with it if thats what you mean.Sorry for giving a low quality answer but your question should be clarified more.

5 0
3 years ago
Write a MARIE program to calculate some basic statistics on a list of positive numbers. The program will ask users to input the
motikmotik

Answer:

a=[23,6,78,36,3,250,127,210,-5]

i = len(a) # calculate length

j = min(a) # calculate minimun

k = sum(a) # calculate sum

l= sum(a)/len(a)  # calculate mean

print(i)

print(j)

print(k)

print(l)

z = 0.0

i=0

x=[23,6,78,36,3,250,127,210,-5]

y = int(l)

while x[i] < y:  

   z= int(x[i]/y)

   print(z)

   x[i] = x[i] - y

   z=z+1

   i=i+1

Explanation:

So above we have calculated Count, minimum, sum and mean/average. Also we did a simple division and printed quotient.

5 0
4 years ago
Consider the practice of outsourcing programmers, a common practice in many U.S. businesses. Think about how this practice is us
GuDViN [60]

The practice of outsourcing programmers is known to be the act of  sharing or delegating as well as handing over control of programming and its associated tasks to any form of  external service provider that is said to be very good in that field and has the power and capabilities to handle the technical and operational areas of a programming project.

<h3>What is outsourcing and why is it always practiced?</h3>

Outsourcing is known to  be a kind of a business practice that entails the act of hiring a party that is known to be outside a company to carry out services or make goods that are said to be traditionally carried out in-house.

Note that The practice of outsourcing programmers is known to be the act of  sharing or delegating as well as handing over control of programming and its associated tasks to any form of  external service provider that is said to be very good in that field and has the power and capabilities to handle the technical and operational areas of a programming project.

Learn more about outsourcing  from

brainly.com/question/12101789

#SPJ1

5 0
2 years ago
One problem with dynamic arrays is that once the array is created using the new operator the size cannot be changed. For example
riadik2000 [5.3K]

Answer:

Un problema con las matrices dinámicas es que una vez que se crea la matriz utilizando el nuevo operador, no se puede cambiar el tamaño. Por ejemplo, es posible que desee agregar o eliminar entradas de la matriz de manera similar al comportamiento de un vector. Este proyecto le pide que cree una clase llamada DynamicStringArray que incluye funciones miembro que le permiten emular el comportamiento de un vector de cadenas.

La clase debe tener:

Una variable miembro privada llamada dynamicArray que hace referencia a una matriz dinámica de tipo cadena.

Una variable de miembro privada llamada tamaño que contiene el número de entradas en la matriz.

Un constructor predeterminado que establece la matriz dinámica en NULL y establece el tamaño en 0.

Una función que devuelve el tamaño.

Una función llamada addEntry que toma una cadena como entrada. La función debe crear una nueva matriz dinámica un elemento más grande que dynamicArray, copiar todos los elementos de dynamicArray en la nueva matriz, agregar la nueva cadena al final de la nueva matriz, incrementar el tamaño, eliminar el antiguo dynamicArray y luego establecer dynamicArray en el nueva matriz.

Una función llamada deleteEntry que toma una cadena como entrada. La función debe buscar la cadena en dynamicArray. Si no lo encuentra, devuelva falso. Si lo encuentra, cree una nueva matriz dinámica con un elemento más pequeño que dynamicArray. Copie todos los elementos excepto la cadena de entrada en la nueva matriz, elimine DynamicArray, reduzca el tamaño y devuelva verdadero.

Una función llamada getEntry que toma un número entero como entrada y devuelve la cadena en ese índice en dynamicArray. Devuelve la cadena "" si el índice está fuera de los límites de dynamicArray.

Sobrecargue el operador [] para que pueda obtener y cambiar un elemento por un índice entero. Si el índice está fuera de los límites, devuelve una cadena "".

Un constructor de copia que hace una copia de la matriz dinámica del objeto de entrada.

Sobrecargue el operador de asignación para que la matriz dinámica se copie correctamente en el objeto de destino.

Un destructor que libera la memoria asignada a la matriz dinámica.

Cree un programa de prueba adecuado para evaluar su clase.

Debería nombrar el proyecto ASG10. Al comprimir la carpeta del proyecto, ASG10, incluya todos los archivos (.sln, .cpp, etc.) y subdirectorios (Debug, etc.).

************************************************

Copie su DynamicStringArray de la Tarea 10. Corrija el programa para que las 13 pruebas funcionen correctamente. Modifique la definición del operador sobrecargado [] y getEntry para que generen una excepción OutOfRange si se usa un índice que está fuera de rango. OutOfRange es una clase de excepción que define. La clase de excepción debe tener un miembro int privado y un miembro string privado, y un constructor público que tenga argumentos int y string. El valor del índice infractor junto con un mensaje deben almacenarse en el objeto de excepción. Tú eliges el mensaje para describir la situación. Modifique su programa de prueba y agregue pruebas que detecten la nueva clase de excepción.

Deberías nombrar

Explanation:

3 0
3 years ago
How do you put sound/music in Google classroom slideshow?
Svet_ta [14]
So, there's no actual way to insert music into your slides unless you use imovie. BUT, you can place a link in one of your slides to a particular song on spotify, and as you are presenting, you can click on the link, and it will open up spotify and play the song you selected. 

Okay so first, go ahead and open up your google slides presentation. 

Then find the specific slides you want to add music to. 

Select Insert from the menu, and then click on text box. Place the text box anywhere in your slide, and you can put some text in there to disguise the link, or you can just paste the link directly. 

TO GET THE LINK: 

Go to spotify.com 
Pick out the song you want to use.
Right click, and select "copy song link" 

Then paste that link in your text box you created! 
6 0
3 years ago
Other questions:
  • Will a company ever finish its social media marketing strategy?
    10·1 answer
  • In order to allow communication between vlans for exchange of data what must be used?​
    15·1 answer
  • Describe how the spoofing attack can affect multiple network layers (application, transport, network, and data link layers).
    14·1 answer
  • How are appointments scheduled in medisoft
    12·1 answer
  • What are the verison of ip user nearly limitless ip address?
    14·1 answer
  • Which of the following resulted in a rightward shift in supply?
    5·1 answer
  • Practice with CSS. a. Write the CSS for an HTML selector footer with the following characteristics: a light-blue background colo
    11·1 answer
  • Which task should happen during the planning stage of a project? reflect on the project outcomes prevent set-backs determine the
    11·1 answer
  • Paravirtualization is ideal for
    9·1 answer
  • Discuss the term internal control​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!