Stuck on this step:
You should display a numbered list of the services you offer before the first prompt for input, each with the format #) <service> . For example, 1) cut , where 1 is the service_id
Code so far is this:
#! /bin/bash
PSQL="psql -X --username=freecodecamp --dbname=salon --tuples-only -c"
#echo -e "\n~~~~~ Salon Appointment Scheduler ~~~~~\n"
MAIN_MENU() {
#display a numbered list of the services you offer before the first prompt for input, each with the format #) <service>
#get services
SERVICES=$($PSQL "SELECT service_id, name FROM services ORDER BY service_id;")
#display services
#echo -e "\nHow may I help you?"
echo "$SERVICES" | while read SERVICE_ID BAR SERVICE_NAME
do
echo "$SERVICE_ID) $SERVICE_NAME"
done
read MAIN_MENU_SELECTION
}
MAIN_MENU
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
I also had encountered some difficulties with this test. I think that you can pass it if you uncomment and move the two echo statement on top, above the MAIN_MENU function.
If you need more help or you need a programming buddy just ask
Thanks for all your help everyone! Found a full solution on twitter so have been learning from that.
So far got a different box ticked:
Your script should prompt users to enter a service_id , phone number, a name if they aren’t already a customer, and a time. You should use read to read these inputs into variables named SERVICE_ID_SELECTED , CUSTOMER_PHONE , CUSTOMER_NAME , and SERVICE_TIME
That one worked, but still got to get the rest of the bottom quarter. Hopefully all I need is time & focus.
Hey Venkatesh,
try this - when you exit first instance of nano after changing pick to r and put into a second nano instance, do not change anything in it just yet and simply run the tests. You’ll pass the test and you will have the next instruction on what exactly to change in the second already active nano instance.
That’s strange, coz it did work in my case;
just to be sure, in the second nano you are just adding an extra s at the end of commit message so it says and not making any other changes and you did not add an r at the beginning of the line in second nano instance. Finally the first line is . Am I right?
Final first line in your second nano instance should be: feat: add column references
really grateful for this thread! just started this curriculum beta a few weeks ago and am really enjoying it. i’m on the celestial bodies database currently and am working on learning to save my progress. the instructions say the following:
If you leave your virtual machine, your database will not be saved. You can make a dump of it by entering pg_dump --clean --create --inserts --username=freecodecamp universe > universe.sql in a terminal (not the psql one). Make sure you are in the project folder when entering the command. It will save the commands to rebuild your database to universe.sql . Then, save the file somewhere. You can rebuild it by entering psql -U postgres < universe.sql in a terminal if you enter the command where the .sql file is.
So, I made a new terminal that says “bash” instead of “psql” where I put in the first line of code that the instructions recommended here. Then it says I should save the file somewhere… is that as simple as clicking File > Save As… in Visual Studio Code? because I’ve just tried that, and no dialog box appeared for me to select a location. Said dialog box didn’t appear for me either after I posted the first line of code. Not sure what I should be expecting to see here after I run this code.
Separate question: Is it possible for me to run Docker and Visual Studio Code on another machine and to be able to pick up from where I left off in a tutorial from one machine in another? I’ve installed both software, Git, and other extensions, but was unable to build the Docker image on that machine since it kept saying that the Docker daemon wasn’t running, even though the software was open prior to opening VSC, and I’ve tried restarting both programs, restarting the computer, etc. Thanks for your patience!
This is probably the command you are looking for. Once you do that, you should SEE the file universe.sql in the folder /rdb-alpha
It’s the folder that you probably saved on the desktop and that runs the Docker container.
EDIT: one final question (that is not necessarily addressed to the person who helped me, but rather anyone) - for statements in the rubric that say blanket statements like, “you should use the INT data type for at least two columns that are not a primary or foreign key” but don’t say “…in each table” at the end, can I assume that out of all of my tables, at least two columns should fulfill this requirement? Or is this something that should be in all of my tables? I’m likely overthinking, but I’d rather ask this now than have to go back and rework my code. Let me know if it’s the former or latter. Thank you!