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
A ____________ would be a misconfiguration of a system that allows the hacker to gain unauthorized access, whereas a____________
Lynna [10]

Answer:

vulnerability, risk

Explanation:

A vulnerability would be a misconfiguration of a system that allows the hacker to gain unauthorized access, whereas a risk is a combination of the likelihood that such a misconfiguration could happen, a hacker’s exploitation of it, and the impact if the event occurred.

6 0
3 years ago
Can someone pelaseee help
aalyn [17]

Answer:

Explanation:

develloppemetn de grace en option est logiquement une biologiste experimenter des annes 1256 a toulouse en france

6 0
2 years ago
A direct-mapped cache holds 64KB of useful data (not including tag or control bits). Assuming that the block size is 32-byte and
Cerrena [4.2K]

Answer:

A) Number of bits for byte = 6 bits

B) number of bits for index = 17 bits

C) number of bits for tag = 15 bits

Explanation:

Given data :

cache size = 64 kB

block size = 32 -byte

block address = 32 -bit

number of blocks in cache memory  

cache size / block size = 64 kb / 32 b = 2^11 hence the number of blocks in cache memory = 11 bits = block offset

A) Number of bits for byte

log _{2} (6)^2 = 6  bits

B) number of bits for index

block offset + byte number

= 11 + 6 = 17 bits

c ) number of bits for tag

= 32 - number of bits for index

= 32 - 17 = 15 bits

5 0
3 years ago
The first row in a table is referred to as the _____ row and the last row is considered the _____ row.
Juliette [100K]

the first row in a table is classed as the header row.

and with the last one I'm not sure because as far as I know there's not considered a last row.

6 0
3 years ago
PLEASE HELP!!!!!! ASAP
NNADVOKAT [17]

Answer:

use a wizard or use a design view

Explanation:

i took the test

4 0
3 years ago
Read 2 more answers
Other questions:
  • When programming, the word "execute" means which of these?
    13·1 answer
  • ____ is an object-oriented programming language from Sun Microsystems which allows small programs called applets to be embedded
    13·1 answer
  • It is important to ____ the line in the code editing window in the exact location where you want to insert a code snippet to pro
    10·1 answer
  • Florida revoked __________ drivers licenses for DUI in a one-year period from 2009 to 2010.
    6·2 answers
  • Explain and give examples of at least two search engines.
    9·1 answer
  • Tamara has $500 she is looking to save for a class trip. She wants to earn the most possible interest and will not need access t
    7·1 answer
  • Draw a flowchart or write pseudocode to represent a program's logic that allows the user to enter a value. The program multiplie
    5·1 answer
  • Jiwoo is a professional photographer. Identify and describe a photography scenario where Jiwoo would need to consider the ethics
    12·1 answer
  • What is a key differentiator of Conversational Artificial Intelligence (AI)
    11·1 answer
  • [2]<br> (c) Describe how the microprocessor can determine when to sound the clock alarm.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!