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
Put these operating systems in order according to the date they were released. (The first to be released would be
uysha [10]
1. ms-dos 1981
2. windows 2.0 1987
3. windows xp 2001
4. mac os 2001
5. windows 7 2009
8 0
3 years ago
The Caesar Cipher has 25 different shifts to try.
statuscvo [17]

Answer:

D. 25x24x23x22x21.....3x2x1.

Explanation:

The ceasar cipher is a encryption technique, that uses a combination of information or keys to encrypt an information.

The 25 shift ceasar cipher has 25 different combinations, so the number of probable random cipher substitution is 25!,

That is = 25 × 24×23× 22×..... ×2×1.

3 0
2 years ago
Which team won the first World Series ?
Ulleksa [173]
Boston Red Sox, Boyo
5 0
3 years ago
Read 2 more answers
What are the tab keys used for on a keyboard
Ugo [173]
The tab keys are used to advance the cursor to the next tab stop.
4 0
3 years ago
A leading pharmaceutical company is launching a major transformation of its entire Cloud operations in order to more quickly and
klasskru [66]

This is a great move for the Pharmaceutical company for a number of reasons.

  • The first and perhaps most important advantage is to the company is that costs relating to Information and Technology (IT) Infrastructure will be reduced to the barest minimum. As a start-up, it is important to keep costs as low as possible. Costs are kept low because the organization will not need to pay the added energy and personnel-related costs of maintaining an elaborate IT infrastructure.

  • The advantage of scalability. Scalability in this sense simply means the ability to take on additional workload or adjust to market demand. As the company grows and attracts more clients, it would need to expand beyond the capacity that it had at the onset. Opting for Cloud as a Service (CaaS) gives them this advantage.

  • Another way CaaS can help the client is that they enjoy the advantage of Business Continuity. Business Continuity is the ability to remain in business regardless of disruptions to the business itself at one location. This is because CaaS providers are structured in such a way that they are able to keep their subscribers in operation regardless of any disasters.

Other advantages to this client are:

  1. Ease and access of automatic updates to the system;
  2. Ease of collaboration between internal and external users of the same system.

Learn more about the merits of Cloud as a Service here:

brainly.com/question/24705780

4 0
2 years ago
Other questions:
  • Which options correctly describe Andrew's job role?
    6·1 answer
  • Elvis has asked Bonnie out on a date to a baseball game. Elvis is a friend of Bonnie's classmate Ginger and she has met him a fe
    5·2 answers
  • Word 2013 in order to share a document online you must first
    10·1 answer
  • Write a code that makes a 2D square array with 20×20 elements. Fill the array with random numbers initially. Then, "draw" a squa
    9·1 answer
  • A Tracking Gantt chart is based on the percentage of work completed for project tasks or the actual start and finish dates. True
    12·1 answer
  • use the internet to research the SYSTEM account. Why is it nessesary to include this account with full control on a directory
    13·1 answer
  • Which of the following statements is true regarding a user account? Once a user account has been created, it cannot be completel
    8·1 answer
  • Leon wants an output from his tablet. What should he look at?
    9·1 answer
  • Which option is an example of an algorithm that is used in daily life?
    8·1 answer
  • Writing queries in sql to compile data from a database is related to the physical level of databases true or false?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!