quiz: Add copyright metadata
[quizzer.git] / quizzes / posix-shell.json
1 {
2         "version": "0.1",
3         "copyright": [
4                 "Copyright (C) 2013 W. Trevor King <wking@tremily.us>",
5                 "",
6                 "This file is part of quizzer.",
7                 "",
8                 "quizzer is free software: you can redistribute it and/or modify it under the",
9                 "terms of the GNU General Public License as published by the Free Software",
10                 "Foundation, either version 3 of the License, or (at your option) any later",
11                 "version.",
12                 "",
13                 "quizzer is distributed in the hope that it will be useful, but WITHOUT ANY",
14                 "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR",
15                 "A PARTICULAR PURPOSE.  See the GNU General Public License for more details.",
16                 "",
17                 "You should have received a copy of the GNU General Public License along with",
18                 "quizzer.  If not, see <http://www.gnu.org/licenses/>."
19                 ],
20         "introduction": "Test your knowledge of the POSIX shell.",
21         "questions": [
22                 {
23                         "class": "ScriptQuestion",
24                         "interpreter": "sh",
25                         "id": "quoting spaces",
26                         "prompt": "Call `ls` and pass it two arguments: `a` and `b c`.",
27                         "answer": "ls a 'b c'",
28                         "compare_answers": true,
29                         "help": "http://pubs.opengroup.org/onlinepubs/009696699/utilities/xcu_chap02.html#tag_02_02"
30                 },
31                 {
32                         "class": "ScriptQuestion",
33                         "interpreter": "sh",
34                         "id": "echo constant",
35                         "prompt": "Print the string `hello, world` to stdout.",
36                         "answer": "echo 'hello, world'",
37                         "compare_answers": true,
38                         "help": "http://pubs.opengroup.org/onlinepubs/009696699/utilities/echo.html"
39                 },
40                 {
41                         "class": "ScriptQuestion",
42                         "interpreter": "sh",
43                         "id": "parameter expansion",
44                         "prompt": "Print the contents of the PATH variable to stdout.",
45                         "answer": "echo \"$PATH\"",
46                         "compare_answers": true,
47                         "help": "http://pubs.opengroup.org/onlinepubs/009696699/utilities/xcu_chap02.html#tag_02_06_02",
48                         "dependencies": [
49                                 "echo constant"
50                                 ]
51                 },
52                 {
53                         "class": "ScriptQuestion",
54                         "interpreter": "sh",
55                         "id": "variable assign constant",
56                         "prompt": "Set the ABC variable to the string `xyz`.",
57                         "answer": "ABC='xyz'",
58                         "post_answer": [
59                                 "echo \"ABC: '${ABC}'\""
60                                 ],
61                         "compare_answers": true,
62                         "help": "http://tldp.org/LDP/abs/html/varassignment.html"
63                 },
64                 {
65                         "class": "ScriptQuestion",
66                         "interpreter": "sh",
67                         "id": "variable assign altered",
68                         "prompt": "Prepend the string `/some/path:` to the PATH variable.",
69                         "answer": "PATH=\"/some/path:$PATH\"",
70                         "post_answer": [
71                                 "echo \"PATH: '${PATH}'\""
72                                 ],
73                         "compare_answers": true,
74                         "help": [
75                                 "http://pubs.opengroup.org/onlinepubs/009696699/utilities/xcu_chap02.html#tag_02_06_02",
76                                 "http://tldp.org/LDP/abs/html/varassignment.html"
77                                 ],
78                         "dependencies": [
79                                 "parameter expansion",
80                                 "variable assign constant"
81                                 ]
82                 }
83         ]
84 }