tengine.sh shell script is a simple quiz engine.
tengine.sh shell script is a simple quiz engine, primarily designed to be used as a login shell, so that prospective UNIX/Linux System Administrators can sit a technical quiz as part of their interview process.

This README assumes that you'll be running tengine.sh as an interactive quiz, not via a login shell. If you want to set it up to run as a login shell for an interviewee, just add make the /usr/local/tengine/bin/tengine.sh script their login shell, and ensure that the interviewee's login account has read access to the entire tengine tree, and write access to the /usr/local/tengine/var/tmp directory, where the results files are stored.

Functionality currently exists within tengine.sh for two types of questions - multiple choice, and fill-in-the-blank.


All steps to be performed as root:

# pwd
# ls
# gzip -dc ./tengine.tar.gz | tar xf -
# rm tengine.tar.gz
# ls

Beneath the tengine directory, you'll find the following directory structure

|------ bin # contains the tengine.sh script
|------ data # contains the question data
| |------ 0001 # sample question directory
| |------ 0002 # sample question directory
|------ var
|------ tmp # directory for temporary files and RESULTS

Because this script was primarily designed for use as a login shell, results are not given directly to the script user, but rather deposited in a file under /usr/local/tengine/var/tmp.

Question Files

Beneath each question directory, you'll find four files. For example, in the 0001 directory, there are the following four files:


The extensions for these files denote the following:

h - header
q - question
a - answers
c - correct answer

The header file is a four-line file formatted thusly:


QUESTIONID can be anything you like, but I like to keep it the same as the question number directory.

TYPE can be either MULTI for multiple choice, or BLANK for a "fill-in- the-blank" type question.

DIFFICULTY is not currently used, and is for future development.

CATEGORY is used to display the question category to the user.

For example, 0001.h may contain:


System Configuration

The question file contains the actual question that will be asked, such as:

In which file is the default runlevel of the system defined?

The answers file contains the possible answers, and is only relevant for multiple-choice questions.

The correct answer file contains the correct answer, against which the users input is compared, for example, 0001.c should contain


For a MULTI question, the answers file may be something like:

a - ext2
b - hsfs
c - pcfs
d - ufs

and the correct answer file would contain the appropriate multiple choice response, such as a simple:


Take a look at the sample questions in the


directory tree for examples of this.


If you want to use the script as a login shell, uncomment the NUM_TO_ASK value and set it to a value less than or equal to the number of questions currently under the data directory tree. If this variable is commented out, the user will be prompted for the number of questions that they wish to attempt.

Results Files

When the user invokes tengine.sh, they'll be prompted for their Full Name. This is used when the results files are generated.

An example results file, found under /usr/local/tengine/var/tmp could be something along the lines of:

a - a
/etc/inittab - /I/Dont/Know
Kevin_Waldron: 1 answer correct out of 2 - 50%

The format for question lines is

correct_answer - answer_given

The last line in the results file is a summary of the test.


The way that questions are asked "randomly" will work a lot faster if there is a large pool of questions to choose from.

last updated on:
March 12th, 2007, 15:10 GMT
license type:
GPL (GNU General Public License) 
developed by:
Kevin Waldron
ROOT \ Utilities
Download Button

In a hurry? Add it to your Download Basket!

user rating



Rate it!

Add your review!