Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Bash script where: The script should first read a file line by line, where each line is a person's information formatted as FirstName

Write a Bash script where:
The script should first read a file line by line, where each line is a person's information
formatted as "FirstName LastName, YYYY-MM-DD, City, Country".
The script should filter the lines to only include people who are from a city that
contains two or more words (e.g., "San Francisco"). Use a regular expression to check
this.
For each of the filtered lines, the script should extract the person's age in years, based
on the date of birth. You'll need to use a regular expression to extract the date of birth and
then calculate the age.
After all ages are calculated, sort the people by their ages in descending order and print
each person's name along with their age.
Note: You can assume that the current year is 2024 for age calculations.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions