From cd086cab49a3fd68970878068ebef9aab4a0cd21 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 5 Feb 2013 14:37:21 -0500 Subject: [PATCH] quizzes/posix-shell: Add a preliminary POSIX shell language quiz --- quizzes/posix-shell.json | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 quizzes/posix-shell.json diff --git a/quizzes/posix-shell.json b/quizzes/posix-shell.json new file mode 100644 index 0000000..e0693f7 --- /dev/null +++ b/quizzes/posix-shell.json @@ -0,0 +1,56 @@ +{ + "version": "0.1", + "questions": [ + { + "class": "ScriptQuestion", + "interpreter": "sh", + "id": "quoting spaces", + "prompt": "call `ls` and pass it two arguments: `a` and `b c`", + "answer": "ls a 'b c'", + "help": "http://pubs.opengroup.org/onlinepubs/009696699/utilities/xcu_chap02.html#tag_02_02" + }, + { + "class": "ScriptQuestion", + "interpreter": "sh", + "id": "echo constant", + "prompt": "print the string `hello, world` to stdout", + "answer": "echo 'hello, world'", + "help": "http://pubs.opengroup.org/onlinepubs/009696699/utilities/echo.html" + }, + { + "class": "ScriptQuestion", + "interpreter": "sh", + "id": "parameter expansion", + "prompt": "print the contents of the PATH variable to stdout", + "answer": "echo \"$PATH\"", + "help": "http://pubs.opengroup.org/onlinepubs/009696699/utilities/xcu_chap02.html#tag_02_06_02", + "dependencies": [ + "echo constant" + ] + }, + { + "class": "ScriptQuestion", + "interpreter": "sh", + "id": "variable assign constant", + "prompt": "set the ABC variable to the string `xyz`", + "answer": "ABC='xyz'", + "teardown": [ + "echo \"ABC: '${ABC}'\"" + ], + "help": "http://tldp.org/LDP/abs/html/varassignment.html" + }, + { + "class": "ScriptQuestion", + "interpreter": "sh", + "prompt": "prepend the string `/some/path:` to the PATH variable", + "answer": "PATH=\"/some/path:$PATH\"", + "teardown": [ + "echo \"PATH: '${PATH}'\"" + ], + "help": "", + "dependencies": [ + "variable assign constant" + ] + } + ] +} -- 2.26.2