Hello.
I’ve built the sql postgres database, have used chmod to give my script executable permissions and the course reads everything. But it won’t read this simple prompt. Please lmk what I’m missing here.
When I run my script in the terminal it keeps giving me this error.
#! /bin/bash
PSQL="psql -X --username=freecodecamp --dbname=postgres --tuples-only -c"
echo "~~~~~ MY SALON ~~~~~"
echo -e "\nWelcome to My Salon, how can I help you?"
MAIN_MENU() {
if [[ $1 ]]
then
echo -e "\n$1"
fi
# list your services
AVAILABLE_SERVICES=$($PSQL "SELECT * FROM services")
echo "$AVAILABLE_SERVICES" | while read SERVICE_ID BAR SERVICE_NAME
do
echo "$SERVICE_ID) $SERVICE_NAME"
done
# get service_id
# get the name of the service
# if it doesn't exist
# send to the main menu
# ask for phone number
# get the customer's name
# if not found
# ask for name
# insert new customer
# ask for the time of appointment
# get the customer ID
}
MAIN_MENU