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]
4 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]4 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 are three requirements of information technology a. Accuracyb. _______________________________c. __________________________
Monica [59]

Answer:

1b. Accessibility  1c. Efficiency  1d. Relevance

2. $10 billion

3. False

4. All of them

5. Drone Delivery

Explanation:

1. Information technology is the study or use of systems (especially computers and telecommunications) for storing, retrieving, and sending information and it must be accurate, accessible, efficient and relevant.

2. Every year about $10 billion is spent on SCM (supply chain management software).

3. supply chain is the network of all the individuals, organizations, resources, activities and technology involved in the creation and sale of a product, from the delivery of source materials from the supplier to the manufacturer, through to its eventual delivery to the end user while software are just virtual tools use in the day to day activities.

4. Every activity mention is creating a new demand for the radio-frequency identification technology.

5. Drone delivery

7 0
3 years ago
What type of social worker provides proctection for children and help for families
Daniel [21]

Answer: Child welfare

Explanation: social workers can work for Child Protective Services and/or child welfare agencies at the county and state levels.

5 0
3 years ago
Read 2 more answers
Which network protocol is used to route ip addresses?.
IgorLugansk [536]

Answer:

the Internet Protocol (IP)

3 0
2 years ago
Explain the differences between the orange industry in California and Florida.
padilas [110]

Answer:

In California the dry weather helps the orange have thicker peels and a very sweet flavor the dry weather also supports the growth of the thickness and sweetness

In Florida the oranges have thinner peels and more although more tart juice the damp heat promotes a juicer orange

4 0
4 years ago
In general, digital to analog modulation equipment is less expensive than the equipment for encoding digital data into a digital
Vesnalui [34]

Answer: False

Explanation:

As for the encoding process we require encoder, decoder, modulator which is less expensive than those required for modulation where we need devices for changing the amplitude, frequency and phase, which is more complex and expensive

3 0
3 years ago
Other questions:
  • Click to review the online content. Then answer the question(s) below, using complete sentences. Scroll down to view additional
    7·1 answer
  • Outlook 2016 is not only an email client, but it can also be used to schedule meetings and
    11·2 answers
  • Which of the following can be sources of sediment? A. fragments of other rocks B. chemicals and minerals dissolved in water C. s
    11·1 answer
  • Why can black holes not be seen?
    5·1 answer
  • A computer has the following parameters Operation Frequency Cycles Arithmetic/Logical instructions 65% 1 Register load operation
    11·1 answer
  • What is the difference between word processing software and email?
    12·2 answers
  • A. Calculate the diffusion coefficient for magnesium in aluminum at 450°C.
    14·1 answer
  • The two major types of system software programs are utility programs and the ________. Select one: A. user interface B. supervis
    13·1 answer
  • Conduct research to determine the best network design to ensure security of internal access while retaining public website avail
    9·1 answer
  • I just tested how resistant my skin is with a multimeter and I stuck the probe tips pretty hard into my left and right hand. The
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!