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
Inessa [10]
3 years ago
10

Your task is to create a bash shell script that is able to backup all the C++ program files in your current directory. The algor

ithm is as follows: Prompt the user to enter a backup directory name. If the backup directory does not exist in the current directory, then create the backup directory. For each .cpp file in the current directory, If there have been changes to the file since the last backup or no copy exists in the backup directory, then copy the current .cpp file to the backup directory and print a message that the file has been backuped. Otherwise, no copy will be made, and print a message that the file is the latest. Deliverables:
1. The code of bash shell script hw1.txt. The shell script file should be hw1.sh, but .sh files can not uploaded to Blackboard, please revise the extension as .txt and then upload it to Blackboard.
2. The script log file hw1log.txt showing the test cases outlined below Test Cases captured in hw1log.txt : 1. Start by removing your backup directory (rm -r backup) 2. Ensure that there are some .cpp files in the current directory
3. Show the directory using ls -l
4. Run the backup script file hw1.sh several times as specified below: Type "backup", to create a backup directory ls -l backup Run your backup script file hw1.sh ls -l backup Append to all the files and rerun your backup script file hw1.sh an good way to append is to type: echo "something" >> file.cpp Append to one file and rerun your backup script file hw1.sh
Computers and Technology
1 answer:
Oliga [24]3 years ago
7 0

Answer:

backup() {

 read dirname;

 if [[ whereis . /`$dirname` 2>  sterr.exe]]  

    then

        mkdir  $dirname

 for f in . / *.cpp

 do

    cp f "path_to_dirname"

    echo "file backup complete"

}

backup( )

Explanation:

The bash script above is used to backup C++ source files in a directory to a backup directory which is created if it does not exist, and copy's each .cpp file to backup, then sends a message to declare its completion.

You might be interested in
What tab on the Ribbon would you select to create a Photo Album ?
tiny-mole [99]

Answer:Go to photos and select albums, there you should see the plus sign on the top left and tap that and you should be able to create a video/photo album

Explanation:

You have to go to photos and select the blue plus sign

7 0
3 years ago
Assume that the population of Mexico is 128 million and that the population increases 1.01 percent annually. Assume that the pop
horrorfan [7]

Answer:

//Define class

public class Main {

 //define main method

 public static void main(String[] args)  

 {

   //declare and initialize the double type variable to 128

   double mexico = 128;

   //declare and initialize the double type variable to 323

   double us = 323;

   //declare and initialize the integer type variable to 0  

   int yr = 0;

   //set the while loop to check which is greater

   while (mexico < us)  

   {

     //increment in the variable by 1

     yr++;

     //initialize in the variables acc. to the percentage

     mexico *= 1.0101;

     us *= 0.9985;

   }

   //print the following results

   System.out.println("Population of the Mexico will be exceed the population U.S. in " + yr + " years");

   System.out.println("Population of the Mexico will be " + mexico + " million");

   System.out.println("and population of the U.S. will be " + us + " million");

 }

}

<u>Output</u>:

Population of the Mexico will be exceed the population U.S. in81 years

Population of the Mexico will be 288.88435953355025 million

and population of the U.S. will be 286.0198193927948 million

Explanation:

<u>Following are the description of the program</u>.

  • Firstly, we define the class 'Main' and inside it, we define the main method.
  • Then, declare two double data type variables which are 'mexico' and 'us' and initialize in it to 128 and 323.
  • Declare integer data type variable 'yr' and initialize in it to 0.
  • Set the while loop and pass the condition to check that the variable 'mexico' is less than the variable 'us' then, increment in the variable 'yr' by 1 and multiply the variables 'us' and 'mexico' by the following percentage.
  • Finally, print the following results with the message.
6 0
3 years ago
What is the size of the program counter for an avr that has a 1 kbyte rom capacity?
horsena [70]

Answer:

9 bits

Explanation:

 We all recognize 1 K bytes as =1024 bytes.  

And the storage medium used for program instructions are the non-volatile flash memories. The MCUs are always 8 bits, and a piece of the instructions revenues two or one 16-bit words. Besides we know program memory magnitude through the device name, and as an instance, the ATmega64x line emanates with 64KB of flash, and the ATmega32x line emanates with 32 KB. And there is nobody like off-chip program memory, and all of the codes that are being implemented by the AVR essentially be on the on-chip flash. However, this restraint is not ever applied to the AT94 FPSLIC AVR/FPGA chips. Also, you must know that AVR is a family of microcontrollers established by ATEL in 1996. It is a Harvard architecture type single-chip 8-bit RISC microcontroller. And it is supposed to be the first microcontroller which applied flash memory for storing the program They are heavily used in embedded systems.  

1k byte = 1024 bytes, However, if the program instruction takes 16 bits.  

And hence it only wishes 512.  

Here and now 512 = 10^9, and henceforth you necessitate 9 bits at minimum.  

excluding you can somehow paginate that (such as through one-bit pagination, you will be necessitating only 8 bits and so on.)  

Therefore the answer here = 9 bits.

5 0
3 years ago
Which tabs are expandable and collapsible? This would be in word 2010
vova2212 [387]
Even though some tabs are expandable and collapsible, Word does not work that way on it's own. I believe I read about an addon that could add that sort of functionality. But that was quite a while ago.

<span>Using heading styles and, outline view and document map is the closest native approach I know of. It is quite good, I use it all day long.</span>
6 0
3 years ago
Write code that outputs variable numDays as follows. End with a newline. If input is 3, output is: Days: 3
kobusy [5.1K]

Answer:

In C++:

#include<iostream>

using namespace std;

int main(){

int numDays;

cin>>numDays;

cout<<"Days: "<<numDays<<endl;

return 0;

}

Explanation:

This line declares numDays as integer

int numDays;

This line gets user input for numDays

cin>>numDays;

This line prints the required output and ends with a newline

cout<<"Days: "<<numDays<<endl;

8 0
3 years ago
Other questions:
  • Which of the following subject lines would be best to use when applying for a position in a high school teacher
    11·1 answer
  • Which access control principle limits a user's access to the specific information required to perform the currently assigned tas
    12·1 answer
  • Explain why the game of economics has no winner
    8·1 answer
  • Vitamins and minerals dissolve easily in water.True or false?
    5·1 answer
  • In this part, you have to implement a linked list that maintains a list of integers in sorted order. Thus, if the list contains
    13·1 answer
  • Why did artists use pinhole cameras during the renaissance?
    8·1 answer
  • Who play fortnite gameeeeeeee
    14·1 answer
  • Did brainly.com go down today? i coudlnt get in it
    15·2 answers
  • How r u<br> ;)<br> happy what day is it
    5·2 answers
  • ANSWER QUICKLY!!!
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!