I am stuck at a test in Learn Bash by programming 5 programs.
The test says,
At the bottom of your script, use echo to print Hello <name>. to the terminal.
So what I have done is
echo echo Hello \$NAME >> questionnaire.sh
which adds the echo Hello $NAME line at the end of the file. If I execute the questionnaire.sh file, it is running perfectly. Reading the input and also showing it.
But it is not passing the test. I don’t know what seems to be the problem. I have reset the tutorial multiple times. Resetting the tutorial, deletes the last line from the file, in this case echo Hello NAME line. Then I type the command again, but still not passing the test. I have added the line manually in the file and still it is not passing the test.
Please suggest any alternative. Stuck at it for the last 2 hours.
It should be a little more clear in the hints. It looks like you are entering something in the terminal maybe? You’re supposed to add echo Hello $NAME. in your script, I believe.
Edit: What it actually maybe looks like is that you are trying to edit your script from the terminal. The intent is to open the file and edit it directly. If you don’t see your files on the left, click the icon on the top left that looks like two pieces of paper to make them visible. Then click on your file to open it in VS Code, then you can just edit it directly.