Have a bonus assignment for a class and am tasked with displaying information given a few different inputs. my current script for this to pull the information I need
#!/bin/bash
date=$1
hour=$2
dayornight=$3
cat $date* | grep -i $hour | grep $dayornight | $4
if [ $4 == "BlackJack*" ]; then awk '{print $1, $2, $3, $4}'
if [ $4 == "Roulette*" ]; then awk '{print $1, $2, $5, $6}'
if [ $4 == "Texas*" ]; then awk '{print $1, $2, $7, $8}'
fi
When I run this with my inputs (filename/hour/am/pm/"BlackJack"), it tells me
"roulette_dealer_finder_by_time_and_game.sh: line 9: BlackJack: command not found" and bricks my terminal depending on what variables I change.
Is there a way to add in a if-then statement in this line of script to pull different columns based on different keywords, for example Texas/Roulette/BlackJack?
bash roulette_dealer_by_time_and_game.sh 0310 5 PM BlackJack would be the command to run it
Hour AM/PM BlackJack_Dealer_FNAME LAST Roulette_Dealer_FNAME LAST Texas_Hold_EM_dealer_FNAME LAST
12:00:00 AM Izabela Parrish Marlene Mcpherson Madina Britton
01:00:00 AM Billy Jones Saima Mcdermott Summer-Louise Hammond
02:00:00 AM Summer-Louise Hammond Abigale Rich John-James Hayward
03:00:00 AM John-James Hayward Evalyn Howell Chyna Mercado
04:00:00 AM Chyna Mercado Cleveland Hanna Katey Bean
05:00:00 AM Katey Bean Billy Jones Evalyn Howell
06:00:00 AM Evalyn Howell Saima Mcdermott Cleveland Hanna
07:00:00 AM Cleveland Hanna Abigale Rich Billy Jones
08:00:00 AM Rahima Figueroa Billy Jones Madina Britton
09:00:00 AM Marlene Mcpherson Cleveland Hanna Summer-Louise Hammond
10:00:00 AM Izabela Parrish Madina Britton John-James Hayward
11:00:00 AM Madina Britton Summer-Louise Hammond Chyna Mercado
12:00:00 PM Summer-Louise Hammond John-James Hayward Katey Bean
01:00:00 PM John-James Hayward Chyna Mercado Evalyn Howell
02:00:00 PM Chyna Mercado Billy Jones Cleveland Hanna
03:00:00 PM Katey Bean Evalyn Howell Rahima Figueroa
04:00:00 PM Evalyn Howell Cleveland Hanna Billy Jones
05:00:00 PM Billy Jones Rahima Figueroa Summer-Louise Hammond
06:00:00 PM Rahima Figueroa John-James Hayward John-James Hayward
07:00:00 PM Marlene Mcpherson Chyna Mercado Chyna Mercado
08:00:00 PM Saima Mcdermott Billy Jones Katey Bean
09:00:00 PM Abigale Rich Evalyn Howell Billy Jones
10:00:00 PM Evalyn Howell Katey Bean Cleveland Hanna
11:00:00 PM Cleveland Hanna Billy Jones Rahima Figueroa
and this is the file it would try to grab information from and based on the $4 input it would grab say coumn 123and4
edit: I updated the script a bit to give a clearer picture of what I'm trying to accomplish. And the game type would just be to designate what column the script should be pulling from. the file name is actually the date so 0310 for example