Get startedGet started for free

Climate calculations in Bash

You are continuing your work as a data scientist for the climate research organization. In a previous exercise, you extracted temperature data for 3 regions you are monitoring from some files from the /temps directory.

Remember, each file contains the daily temperature for each region. However, only two regions will be used in this exercise.

In this exercise, the lines from your previous exercise are already there which extract the data from each file. However, this time you will then store these variables in an array, calculate the average temperature of the regions and append this to the array.

For example, for temperatures of 60 and 70, the array should have 60, 70, and 65 as its elements.

This exercise is part of the course

Introduction to Bash Scripting

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise