I have a TSV table and I'm trying to use bash to extract values from a specific row based on the user's input, and then assign those values to variables for use later.
Example table (columns are tab-delimited):
NAME FOOD TIME
Eric pasta 8pm
Sally bread 11am
Jeff ribeye steak with fries 10pm
My goal:
echo Enter your name
read name
echo Hello, $name
(Select the row that matches the $name value and assign FOOD and TIME to $food and $time respectively)
echo You'll be having $food at $time
I did some reading and perhaps awk might be able to accomplish this, but I'm completely lost. How should I go about doing this?