-
-
Notifications
You must be signed in to change notification settings - Fork 121
/
tutorial.json
5425 lines (5425 loc) · 168 KB
/
tutorial.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"id": "freeCodeCamp/learn-bash-scripting-by-building-five-programs:v1.0.0",
"version": "2.0.0",
"summary": {
"title": "Learn Bash Scripting by Building Five Programs",
"description": "> Welcome to the Bash Scripting lessons!"
},
"config": {
"setup": {
"commands": [
"./.freeCodeCamp/setup.sh",
"cd .freeCodeCamp && npm install"
],
"commits": [
"d1729d3899c17eeece566fe71d05efc208a7004d"
]
},
"testRunner": {
"command": "npm run programmatic-test",
"args": {
"tap": "--reporter=mocha-tap-reporter"
},
"directory": ".freeCodeCamp"
},
"repo": {
"uri": "https://github.com/freeCodeCamp/learn-bash-scripting-by-building-five-programs",
"branch": "v2.0.0"
},
"continue": {
"commands": [
"./.freeCodeCamp/setup.sh",
"./.freeCodeCamp/reset.sh"
]
},
"reset": {
"commands": [
"./.freeCodeCamp/setup.sh",
"./.freeCodeCamp/reset.sh"
]
},
"dependencies": [
{
"name": "node",
"version": ">=10"
}
],
"webhook": {
"url": "https://api.freecodecamp.org/coderoad-challenge-completed",
"events": {
"init": false,
"reset": false,
"step_complete": false,
"level_complete": false,
"tutorial_complete": true
}
}
},
"levels": [
{
"id": "10",
"title": "Start the Terminal",
"summary": "",
"content": "",
"steps": [
{
"id": "10.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"c7055e012705b9ad2507f88d29235c8e89a730b2"
]
},
"content": "**The first thing you need to do is start the terminal.** Do that by clicking the \"hamburger\" menu at the top left of the screen, going to the \"terminal\" section, and clicking \"new terminal\". Once you open a new one, type `echo hello bash` into the terminal and press enter.",
"hints": [
"Capitalization matters",
"If the tests don't run automatically, \"trash\" all the terminals and try the instructions again"
]
}
]
},
{
"id": "20",
"title": "touch questionnaire.sh",
"summary": "",
"content": "",
"steps": [
{
"id": "20.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"6837d9633c2074f949f97f2660f750ecd79802cd"
]
},
"content": "You can run commands in the terminal or put them in a file to be run as a script. You will be making five small programs to learn some scripting. The first one will be a \"questionnaire\". Use the `touch` command to create `questionnaire.sh` in the `project` folder.",
"hints": [
"Type `touch questionnaire.sh` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"Enter `cd ~/project` in the terminal to get to the project folder if you aren't there"
]
}
]
},
{
"id": "30",
"title": "Add echo questionnaire",
"summary": "",
"content": "",
"steps": [
{
"id": "30.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"69d8cb725b6eb494b76e5cfad8b3473846aad07b"
]
},
"content": "To start, open the file in the main editor by clicking the filename in the left side panel.\nThen, add the text `echo hello questionnaire` at the top of the file.",
"hints": [
"If the left side panel isn't visible, click the icon that looks like two pieces of paper \nat the top left to open the panel. Then, click on your file to open it",
"Add the suggested text to the `questionnaire.sh` file"
]
}
]
},
{
"id": "35",
"title": "sh questionnaire.sh",
"summary": "",
"content": "",
"steps": [
{
"id": "35.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"e0d7f17ade077b64b799e8f3c24a6ffb4b978a65"
]
},
"content": "Your script has one command. Run it with `sh questionnaire.sh` to see what happens. `sh` stands for `shell`.",
"hints": [
"Type `sh questionnaire.sh` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"Enter `cd ~/project` in the terminal to get to the project folder if you aren't there"
]
}
]
},
{
"id": "40",
"title": "bash questionnaire.sh",
"summary": "",
"content": "",
"steps": [
{
"id": "40.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"6a2a08c856faf28356a7d6f2b8f159a412ce411b"
]
},
"content": "Using `sh` to run your script uses the `shell` interpreter. Run your script again with `bash questionnaire.sh` to use the `bash` interpreter. `bash` stands for `bourne-again shell`.",
"hints": [
"Type `bash questionnaire.sh` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"Enter `cd ~/project` in the terminal to get to the project folder if you aren't there"
]
}
]
},
{
"id": "50",
"title": "which bash",
"summary": "",
"content": "",
"steps": [
{
"id": "50.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"d80dd97b71cd6abd02d2ed4b724ee7c8d25f8b8d"
]
},
"content": "The output was the same. There are many interpreters which may not give the output you expect. Find out where the `bash` interpreter is located by entering `which bash` in the terminal.",
"hints": [
"Type `which bash` in the terminal and press enter"
]
}
]
},
{
"id": "60",
"title": "Add shebang",
"summary": "",
"content": "",
"steps": [
{
"id": "60.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"e3f077b1b818ede2918a33226460e5f1c583e3b8"
]
},
"content": "That's the absolute path to the `bash` interpreter. You can tell your program to use it by placing a `shebang` at the very top of the file like this: `#!<path_to_interpreter>`. Add a `shebang` at the very top of your file, the one you want looks like this: `#!/bin/bash`.",
"hints": [
"Add `#!/bin/bash` at the top of your `questionnaire.sh` file"
]
}
]
},
{
"id": "70",
"title": "./questionnaire",
"summary": "",
"content": "",
"steps": [
{
"id": "70.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"2313d3900a07704a6c6f6bed5d7d2ff7d956e1f9"
]
},
"content": "Now, instead of using `sh` or `bash` to run your script. You can run it by executing the file and it will default to bash. Execute your script with `./questionnaire.sh`. You will get a permission denied error.",
"hints": [
"Type `./questionnaire.sh` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"Enter `cd ~/project` in the terminal to get to the project folder if you aren't there"
]
}
]
},
{
"id": "80",
"title": "ls -l",
"summary": "",
"content": "",
"steps": [
{
"id": "80.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"00bf064f1c87ea54174be60ca796c248472f6f19"
]
},
"content": "You should have got a permission denied message because you don't have permissions to execute the script. List what's in the `project` folder in long list format with `ls -l` to see the file permissions.",
"hints": [
"Type `ls -l` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"Enter `cd ~/project` in the terminal to get to the project folder if you aren't there"
]
}
]
},
{
"id": "90",
"title": "chmod +x questionnaire.sh",
"summary": "",
"content": "",
"steps": [
{
"id": "90.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"edb643af58d65a2bef0abb46a89adffdf93de6e8"
]
},
"content": "Next to your file is `-rw-r--r--`. All but the first character (`-`) describe permissions different users have with the file. `r` means `read`, `w` means `write`, `x` means `execute`. I don't see an `x` anywhere, so nobody can execute it. Enter `chmod +x questionnaire.sh` in the terminal to give everyone executable permissions.",
"hints": [
"Type `chmod +x questionnaire.sh` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"Enter `cd ~/project` in the terminal to get to the project folder if you aren't there"
]
}
]
},
{
"id": "100",
"title": "ls -l",
"summary": "",
"content": "",
"steps": [
{
"id": "100.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"5310b0313f2fbe4fb69aea2dc5a962cb56f81e19"
]
},
"content": "List what's in the folder again with `ls -l` to see the new permissions.",
"hints": [
"Type `ls -l` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"Enter `cd ~/project` in the terminal to get to the project folder if you aren't there"
]
}
]
},
{
"id": "110",
"title": "./questionnaire",
"summary": "",
"content": "",
"steps": [
{
"id": "110.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"ce6200621c29675760247ac8cfff085734096a05"
]
},
"content": "The `x` was added by each type of user to denote that anyone can execute the file. Run your file again by executing it with `./questionnaire.sh`.",
"hints": [
"Type `./questionnaire.sh` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"Enter `cd ~/project` in the terminal to get to the project folder if you aren't there"
]
}
]
},
{
"id": "140",
"title": "Add ls -l",
"summary": "",
"content": "",
"steps": [
{
"id": "140.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"975fe36751980fe05bc01a7330f4deb38161e584"
]
},
"content": "Now it works. In your script, you can add any commands that you would be able to enter in the terminal. Test this by adding the `ls -l` command below your other command.",
"hints": [
"Add `ls -l` at the bottom of your `questionnaire.sh` file"
]
}
]
},
{
"id": "150",
"title": "./questionnaire",
"summary": "",
"content": "",
"steps": [
{
"id": "150.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"032ce400565f170571d69eed514d8d81f157efe3"
]
},
"content": "Run the script by executing it again.",
"hints": [
"Type `./questionnaire.sh` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"Enter `cd ~/project` in the terminal to get to the project folder if you aren't there"
]
}
]
},
{
"id": "160",
"title": "Delete all - shebang",
"summary": "",
"content": "",
"steps": [
{
"id": "160.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"699bbe17489321f53b356eb4c72b5ab16823822a"
]
},
"content": "Your script printed the result of the two commands as if you entered them in the terminal. Delete everything but the `shebang` from your file so you can start making the questionnaire.",
"hints": [
"Only `#!/bin/bash` should remain in your `questionnaire.sh` file"
]
}
]
},
{
"id": "170",
"title": "Add QUESTION1 variable",
"summary": "",
"content": "",
"steps": [
{
"id": "170.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"a0d5b9d8199f61a9c864b65c4f1e3b95eee21f5b"
]
},
"content": "Bash has variables, functions, and other things you might be familiar with. You can create a variable with `VARIABLE_NAME=VALUE`. There cannot be any spaces around the equal (`=`) sign. If a variable has any spaces in it, place double quotes around it. Create a variable named `QUESTION1` and set it's value to `\"What's your name?\"`.",
"hints": [
"Add `QUESTION1=\"What's your name?\"` at the bottom of your `questionnaire.sh` file"
]
}
]
},
{
"id": "180",
"title": "Add echo $QUESTION1",
"summary": "",
"content": "",
"steps": [
{
"id": "180.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"cbc4c0e5e6abed357990b57c0e64b66edf5c7fd4"
]
},
"content": "To use a variable, place `$` in front of it like this: `$VARIABLE_NAME`. Shell scripts run from top to bottom, so you can only use variable below where it's created. Use `echo` to print your variable.",
"hints": [
"Add `echo $QUESTION1` at the bottom of your `questionnaire.sh` file"
]
}
]
},
{
"id": "190",
"title": "./questionnaire",
"summary": "",
"content": "",
"steps": [
{
"id": "190.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"626efba75ba0d8f6cbc2ad4cdb8d492702aaaf16"
]
},
"content": "Run the file like you did before to see if it worked.",
"hints": [
"Run your file by executing it",
"Type `./questionnaire.sh` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"Enter `cd ~/project` in the terminal to get to the project folder if you aren't there"
]
}
]
},
{
"id": "200",
"title": "Add read NAME",
"summary": "",
"content": "",
"steps": [
{
"id": "200.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"4dae6eafeb5ea31210b27998086a4fc55d023dd1"
]
},
"content": "The question was printed. Next, you want to be able to accept input from a user. You can do that with `read` like this: `read VARIABLE_NAME`. This will get user input and store it into a new variable. After you print the question, use `read` to get input and store it in a variable named `NAME`.",
"hints": [
"Add `read NAME` at the bottom of your `questionnaire.sh` file"
]
}
]
},
{
"id": "210",
"title": "Add echo Hello $NAME",
"summary": "",
"content": "",
"steps": [
{
"id": "210.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"9317dd685bbefcecac158c2358b42a26b3ce76e8"
]
},
"content": "At the bottom of your script, use `echo` to print `Hello <name>.` to the terminal.",
"hints": [
"You can use your `NAME` variable like this: `$NAME`",
"Use your `$NAME` variable in place of `<name>`",
"Don't forget the period",
"Add `echo Hello $NAME.` at the bottom of your script"
]
}
]
},
{
"id": "220",
"title": "./questionnaire",
"summary": "",
"content": "",
"steps": [
{
"id": "220.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"c81cb6d5774fcaedc5ead1ebe5de54e40f2c9f37"
]
},
"content": "Run the file again. Type your name and press enter after it asks for it.",
"hints": [
"Run your file by executing it",
"Type `./questionnaire.sh` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"Enter `cd ~/project` in the terminal to get to the project folder if you aren't there",
"You can press `ctrl+c` to close the program"
]
}
]
},
{
"id": "230",
"title": "Add QUESTION2 variable",
"summary": "",
"content": "",
"steps": [
{
"id": "230.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"696078c01b4aa042cb3a918029c92cc234a1ede6"
]
},
"content": "Right below your first variable, create another one named `QUESTION2`. Set the value to, `Where are you from?`. Make sure to put it in double quotes.",
"hints": [
"Here's an example: `VARIABLE=\"value\"`",
"Add `QUESTION2=\"Where are you from?\"` to your script"
]
}
]
},
{
"id": "240",
"title": "Add echo $QUESTION2",
"summary": "",
"content": "",
"steps": [
{
"id": "240.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"5a3ea50c1862b9b8f3788e29071962594904d8a8"
]
},
"content": "After your `read` command, use your new variable to print the next question.",
"hints": [
"Use `echo` to print the variable",
"Add `echo $QUESTION2` below your `read` command"
]
}
]
},
{
"id": "250",
"title": "Add read LOCATION",
"summary": "",
"content": "",
"steps": [
{
"id": "250.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"eb61d4fac03be52d45c129ccf4b04ae1d64e5fb8"
]
},
"content": "Below where the second question is printed, use `read` to get input from the user into a variable named `LOCATION`.",
"hints": [
"Here's an example `read VARIABLE_NAME`",
"Add `read LOCATION` to your script below `echo $QUESTION2`"
]
}
]
},
{
"id": "260",
"title": "Add echo Hello $NAME from $LOCATION",
"summary": "",
"content": "",
"steps": [
{
"id": "260.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"f113517382ddca8215e89e2d75f48b346028edf7"
]
},
"content": "Change the existing response to `Hello <name> from <location>.`.",
"hints": [
"Use your two variables in place of `<name>` and `<location`",
"Use your two variables with `$NAME` and `$LOCATION`",
"Make sure the command is at the bottom of the file",
"The suggested command should look like: `echo Hello $NAME from $LOCATION.`"
]
}
]
},
{
"id": "270",
"title": "./questionnaire",
"summary": "",
"content": "",
"steps": [
{
"id": "270.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"d27c231473a948c1758efc4d0a6f15c4823783f4"
]
},
"content": "Run the script and enter values when it is waiting for input.",
"hints": [
"Run your file by executing it",
"Type `./questionnaire.sh` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"You can press `ctrl+c` to close a program"
]
}
]
},
{
"id": "280",
"title": "Add echo \"~~ Questionnaire ~~\"",
"summary": "",
"content": "",
"steps": [
{
"id": "280.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"5f48fe866a3699d798f2c67a875558b69fb46961"
]
},
"content": "It's looking good. I want a title to appear when the program first starts. Use `echo` to print `~~ Questionnaire ~~` before anything else is printed.",
"hints": [
"Add `echo ~~ Questionnaire ~~` below your `shebang`"
]
}
]
},
{
"id": "290",
"title": "./questionnaire",
"summary": "",
"content": "",
"steps": [
{
"id": "290.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"7311cf9ba9c87587875e0d279cea64d18921a461"
]
},
"content": "Run the script and enter values until it is done again so you can see what the title looks like.",
"hints": [
"Run your file by executing it",
"Type `./questionnaire.sh` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"You can press `ctrl+c` to close the program"
]
}
]
},
{
"id": "300",
"title": "echo --help",
"summary": "",
"content": "",
"steps": [
{
"id": "300.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"c6d9a5ae4eef3a89de8b596baf032222f9395a3d"
]
},
"content": "It would be nice if there was some empty lines around the title. You've probably used the `--help` flag before, see if you can use it with `echo` to try and find a way to add empty lines.",
"hints": [
"Enter the suggested command in the terminal",
"Here's an example: `<command> <flag>`",
"The command is `echo`, the flag is `--help`",
"Type `echo --help` in the terminal and press enter"
]
}
]
},
{
"id": "310",
"title": "man echo",
"summary": "",
"content": "",
"steps": [
{
"id": "310.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"76aed3123c7f7636f897f35c85de07b14fa69e22"
]
},
"content": "That didn't work as I hoped. Another way to find information about a command is with `man`. It stands for `manual` and you can use it like this: `man <command>`. See if there's a manual for `echo`.",
"hints": [
"Type `man echo` in the terminal and press enter",
"Press enter until you have seen the whole menu"
]
}
]
},
{
"id": "320",
"title": "Add echo -e \\n~~ Questionnaire ~~\\n",
"summary": "",
"content": "",
"steps": [
{
"id": "320.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"7b00267cbc979d62d39392c6f6a4055ec527f4a4"
]
},
"content": "At the top of the menu, the `-e` option looks promising. And the `\\n` below it says `new line`. You should take a look at those. In your script, change the title to `echo -e \\n~~ Questionnaire ~~\\n` to see if that prints the empty lines.",
"hints": [
"Change the suggested line to `echo -e \\n~~ Questionnaire ~~\\n`"
]
}
]
},
{
"id": "323",
"title": "./questionnaire",
"summary": "",
"content": "",
"steps": [
{
"id": "323.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"c95ec4f32a9629903aad8c0f9a0cd95c4addbc36"
]
},
"content": "Run it to see if it worked. You can press `ctrl+c` to close the program after it starts if you don't want to enter values.",
"hints": [
"Run your file by executing it",
"Type `./questionnaire.sh` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"You can press `ctrl+c` to close the program"
]
}
]
},
{
"id": "326",
"title": "Change to echo -e \"\\n~~ Questionnaire ~~\\n\"",
"summary": "",
"content": "",
"steps": [
{
"id": "326.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"87149c5f3041ab4804bbe6acd866e2b8a9d8a2fd"
]
},
"content": "It didn't print the empty lines. `echo` will only print empty lines if the value is enclosed in quotes. Place double quotes around the title that gets printed to see if it works.",
"hints": [
"Change the suggested line to `echo -e \"\\n~~ Questionnaire ~~\\n\"`"
]
}
]
},
{
"id": "330",
"title": "./questionnaire",
"summary": "",
"content": "",
"steps": [
{
"id": "330.1",
"setup": {
"watchers": [
"../.bash_history"
],
"commits": [
"b03cdc968e546bab177dad6ceb397427c8b13f32"
]
},
"content": "Run your script again to see if that fixed it.",
"hints": [
"Run your file by executing it",
"Type `./questionnaire.sh` in the terminal and press enter",
"Make sure you are in the `project` folder first",
"You can press `ctrl+c` to close the program"
]
}
]
},
{
"id": "340",
"title": "Add QUESTION3 variable",
"summary": "",
"content": "",
"steps": [
{
"id": "340.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"041b3d5602ba49e25aa04fb54cb9875a29ae8ff9"
]
},
"content": "Now it's working :smile: Create a `QUESTION3` variable next to the other two, set it's value to `\"What's your favorite coding website?\"`",
"hints": [
"Add `QUESTION3=\"What's your favorite coding website?\"` to your `questionnaire.sh` file",
"Add it by the other two variables"
]
}
]
},
{
"id": "345",
"title": "echo QUESTION3 variable",
"summary": "",
"content": "",
"steps": [
{
"id": "345.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"e44827108d65c0c681a48a5d93561ac475bea276"
]
},
"content": "Use `echo` to print the third question after you `read` the `LOCATION`.",
"hints": [
"Add `echo $QUESTION3` below the `read LOCATION`",
"Add it to your `questionnaire.sh` file"
]
}
]
},
{
"id": "350",
"title": "read WEBSITE",
"summary": "",
"content": "",
"steps": [
{
"id": "350.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"3d3cfa4d94744740d9052acd427615dc0dd7e362"
]
},
"content": "After the question you just printed, add code to read input into a variable named `WEBSITE`.",
"hints": [
"Add `read WEBSITE` below the `echo $QUESTION3`"
]
}
]
},
{
"id": "360",
"title": "echo final sentence",
"summary": "",
"content": "",
"steps": [
{
"id": "360.1",
"setup": {
"watchers": [
"./questionnaire.sh"
],
"commits": [
"b49d95cfbe45dcc3586d871b87413046c2eb0dc7"
]
},
"content": "Change the `echo` command of the response to print this sentence instead: `Hello <name> from <location>. I learned that your favorite coding website is <website>!`.",
"hints": [
"Replace the `echo Hello $NAME from $LOCATION.` with the suggested sentence",
"Use your three variables in place of `<name>`, `<location>`, and `<website>`",
"The command should look like this: `echo Hello $NAME from $LOCATION. I learned that your favorite coding website is $WEBSITE!`"
]
}
]
},
{
"id": "363",
"title": "./questionnaire",
"summary": "",
"content": "",
"steps": [
{
"id": "363.1",
"setup": {
"watchers": [
"../.bash_history"
],