I have to manipulate a CSV file (formed by cars and some of their characteristics) and output something like:
The car name is $car_name
Every time I run the program I want to show a different car. This is the code I have for the moment:
#! /bin/bash
lines_total=`wc -l < cars.csv`
car_name=
let line_number=$(( (RANDOM % $lines_total) + 1 ))
echo "The car name is `$car_name`"
What should I write as value of the $car_name variable so that it shows a random car every time?
The cars.csv content is like this, each line is a different car with their own properties, for example:
Car;Year;Origin;Max Speed;Miles per Gallon