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
_____ are used to associate a style sheet or style rule with a specific device or list of device features.â
Usimov [2.4K]
Media queries are used to associate a style sheet or style rule with a specific device or list of device features<span> .This technique is used for delivering a tailored style sheet to different devices and applying </span><span>CSS styles depending on a device's general type, specific characteristics  or environment.
</span>
6 0
3 years ago
Read 2 more answers
You would set a ___________ to prevent users from immediately changing their password several times in one day to return to the
Temka [501]

Answer:

The answer is (B) Maximum password age.

Explanation:

To prevent several changing of passwords by a user in a day, the maximum times a password can be rest within a day is normally set by  the system administrator.

The setting ensures the password is returned to the current settings of the password on the system for the user and prevents unnecessary changing of passwords in a day by user.

6 0
3 years ago
Read 2 more answers
Is frequency measured in henry.
soldier1979 [14.2K]
No its measured in Hertz Hz
5 0
3 years ago
What's your fav show?
mezya [45]

Answer:

<h3>ITS DEPENDS IF I'M INTERESTED</h3>

Explanation:

HBU?^_________^

6 0
3 years ago
Read 2 more answers
What is a disadvantage of shopping online?A.Harder to compare prices than in storesB.A higher risk of financial data theftC.More
babymother [125]

.A higher risk of financial data theftC

7 0
3 years ago
Read 2 more answers
Other questions:
  • 1) which colour filter is used to pumps up black and white effects?
    13·1 answer
  • In python,_______ are used to define the conditions necessary for a while loop to run.
    7·2 answers
  • In which of the following situations will a macro make your work more efficient?
    9·1 answer
  • Use fuel with the _____________ rating recommended by your vehicle manufacturer. A ) Converter B) Emission C) Exhaust D) Octane
    9·2 answers
  • How do you mark peoples answer as the brainliest answer? I have trouble doing so. Please help!
    10·2 answers
  • Many of the first photographers were actullay scientists and inventors
    11·1 answer
  • Is there a way to earn free robux
    7·2 answers
  • What is data Communications​
    11·2 answers
  • Which user interface part shows graphical output of mined data?
    8·2 answers
  • Which of the expressions is false? when a = 10 and b = 4
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!