From 0aad5705f1a0f83a6788654592bbcb288c5261cb Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 5 Feb 2013 14:10:03 -0500 Subject: [PATCH] quizzes/posix-utilities: Rename from posix-shell.json and flesh out Added few more questions: * print the current directory to stdout * change to your home directory * change to the parent of your current working directory * print the contents of README file to the terminal The renaming is because the tests are testing knowledge of POSIX utilities, not knowledge of the shell syntax itself. --- quizzes/posix-shell.json | 15 ---------- quizzes/posix-utilities.json | 58 ++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 15 deletions(-) delete mode 100644 quizzes/posix-shell.json create mode 100644 quizzes/posix-utilities.json diff --git a/quizzes/posix-shell.json b/quizzes/posix-shell.json deleted file mode 100644 index 192958c..0000000 --- a/quizzes/posix-shell.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "0.1", - "questions": [ - { - "class": "ScriptQuestion", - "interpreter": "sh", - "prompt": "list all the files in the current directory", - "answer": "ls", - "setup": [ - "touch file-1 file-2 file-3" - ], - "help": "http://pubs.opengroup.org/onlinepubs/009696699/idx/utilities.html" - } - ] -} diff --git a/quizzes/posix-utilities.json b/quizzes/posix-utilities.json new file mode 100644 index 0000000..43c30af --- /dev/null +++ b/quizzes/posix-utilities.json @@ -0,0 +1,58 @@ +{ + "version": "0.1", + "questions": [ + { + "class": "ScriptQuestion", + "interpreter": "sh", + "prompt": "list all the files in the current directory", + "answer": "ls", + "setup": [ + "touch file-1 file-2 file-3" + ], + "help": "http://pubs.opengroup.org/onlinepubs/009696699/idx/utilities.html" + }, + { + "class": "ScriptQuestion", + "interpreter": "sh", + "prompt": "print the current directory to stdout", + "answer": "pwd", + "help": "http://pubs.opengroup.org/onlinepubs/009696699/idx/utilities.html" + }, + { + "class": "ScriptQuestion", + "interpreter": "sh", + "prompt": "change to your home directory", + "answer": "cd", + "teardown": [ + "pwd" + ], + "help": "http://pubs.opengroup.org/onlinepubs/009696699/idx/utilities.html" + }, + { + "class": "ScriptQuestion", + "interpreter": "sh", + "prompt": "change to the parent of your current working directory", + "answer": "cd ..", + "teardown": [ + "pwd" + ], + "help": "http://pubs.opengroup.org/onlinepubs/009696699/idx/utilities.html", + "dependencies": [ + "change to your home directory" + ] + }, + { + "class": "ScriptQuestion", + "interpreter": "sh", + "prompt": "print the contents of README file to the terminal", + "answer": "cat README", + "setup": [ + "echo 'This project is wonderful' > README" + ], + "help": "The README file is in your current directory.\nhttp://pubs.opengroup.org/onlinepubs/009696699/idx/utilities.html", + "dependencies": [ + "list all the files in the current directory" + ] + } + ] +} -- 2.26.2