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
In a packet voice communications system, a source transmits packets containing digitizedspeech to a receiver. Because transmissi
omeli [17]

The answer & explanation for this question is given in the attachment below.

5 0
3 years ago
What are examples of people who own the copyrights of their property? Check all that apply.
jolli1 [7]
"Nevaeh thinks of a name for her new company", "Alexis thinks of an idea for a new product" and "Josiah writes a poem" are open to copyright because they can claim that their work is original and cannot be reproduced without their consent. 
3 0
3 years ago
Read 2 more answers
True or False? Any edition or version of Windows can join a domain.
Veseljchak [2.6K]

Answer: TRUE! 100%

If I was helpful i would to be rated brainliest please thank you!

Explanation:

8 0
2 years ago
What are characteristics of fluent readers? Check all that apply. reading known words automatically pronouncing words correctly
IRINA_888 [86]

Answer:

D,A,B hope this is it!!!!!

7 0
2 years ago
Read 2 more answers
How can chess computers be programmed so that it can be so accurately adjusted to a skill level ranging from a beginner to a gra
Elis [28]
They are artificially intelligent. They watch thousands of hours of videos of the game they are going to play. After they learn, they challenge themselves against themselves and save all the moves it used that time, they play another game against the saved game and if they best it then they save the new and repeat. I am not sure about this because I am just a 15 yr old but the early ones brute forced the game and one. Brute Forcing is a way to try out every possible move and pick the most like to succeed or the most efficient one, brute force is also used in hacking or cracking passwords that have something in common. Like let's say ur password is Jakeis35. I would make a list that would be:
Jake
jake
Is
is
35
34

and with a software it will put together every possible pair and will stop when it matches the password on the server or if the password let it login.
5 0
3 years ago
Other questions:
  • On what dates did the 2016 Olympics take place( list all)
    9·2 answers
  • Knowledge flows from the information that has been generated. Which of the following does not necessarily flow from information
    15·1 answer
  • What are the types of action involving data base?
    14·1 answer
  • The analog signals that carry analog or digital data comprise composites built from combinations of simple sine waves.
    12·1 answer
  • Write a new program called Lab7D that will read strings from a text file and turn them into "encrypted code". Create a bool func
    14·1 answer
  • Which of the following parameters should match in order for a pair of routers to form an adjacency when running OSPFv2? (Points
    9·1 answer
  • laire writes a letter to her grandmother, in which she describes an amusement park she visited last week. She adds pictures of t
    11·1 answer
  • Which os the following is NOT true about the proof of work concept?
    8·1 answer
  • host b is sending an email intented for the user on host a to the mail server what protocol is being used to send the message
    10·1 answer
  • 3. What of the following is the main components of computer system?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!