LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   linux script need help (https://www.linuxquestions.org/questions/linux-newbie-8/linux-script-need-help-842001/)

too beginner 11-02-2010 07:49 PM

linux script need help
 
hi ,

i need your help to creat script because i'm beginner

and i would like to learn about linux but i'v some

difficulties faced me could you please help me to creat this script below

--------------------------------------------------



You have been asked to build a prototype phase test script, called*phase*, for a Professor X - the user. The script will be set up in a directory called *phasetest* in the user's home directory. Students should then be given access so they can run it. The program should be as general purpose as possible and as robust as possible. It should display a set of multiple choice questions, read the answer and check whether the answer is right. The overall score for every student should be recorded as well. The interface will be text based and so fairly rudimentary and should have these Questions

.....

. How would you create a new directory called docs?

a) makedocs
b) mkdir docs
c) create docs
d) none of these

2. How would you delete a file called textFile?

a) delete textFile
b) remove textFile
c) rm textFile
d) none of these

3. How would you create an empty file called tempFile?

a) cat tempFile
b) empty tempFile
c) create tempFile
d) touch tempFile

4. What is the command to read the content of a file?

a) cat fileName
b) more fileName
c) less filename
d) all of above

5. What is the command to display a list of all files, including the hidden files?

a) ls –a
b) ls –all
c) display –hidden
d) ls –l

*Enter question number, N for next question, P for previous question or Q for done*
*n*
10. The command chmod is used to change permissions on a file. What .... etc





At the end it should tell the participant how many questions they got right. You should check that the person doing the test is who they say they are (as far as you can) and that they haven't done the test before. e.g. something like
....
Enter your ID
*John*
You only have one attempt and you have already done the test
....
If possible you should incorporate a time limit on the test. As well as the phase script you should also provide a script which will display all the results in either alphabetic order, or numeric order. If your scripts need any setting up then you should provide a setup script.

You should make the scripts as robust as possible since they will be used by a non specialist. They should be designed to operate from a directory called *phasetest *(under the user's home directory. Note - your scripts should be called *phase, display *and* setup




summary:*

cerat 4 files Setup, Phase, Display and User

- admin run Setup file then Setup file creat directory called PhaseTest and copy (Phase and Display) files into PhaseTest

- the student run ./phase it should ask him about username and password which are stored in User file .and compare the input with variables in User file if they match then let him do his test within 10 minutes the timer should apper to the student if student press N then go to next question press P go to previous question press Q save his score in Display file and he can see thim in Display if the time finished also save his score in Display. if th student want to do exam again Phase test should check his username & password if he did it before
type to him "you did your exam check ./Display to see your result.

michaelk 11-02-2010 08:17 PM

Welcome to LinuxQuestions.

Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.

onebuck 11-03-2010 06:46 AM

Hi,

Welcome to LQ!

Maybe you should review the LQ Rules;


Quote:

Do not expect LQ members to do your homework - you will learn much more by doing it yourself.

Start out at items 4, 5 and 6 below.



Just a few links to aid you to gaining some understanding;


1 Linux Documentation Project
2 Rute Tutorial & Exposition
3 Linux Command Guide
4 Bash Beginners Guide
5 Bash Reference Manual
6 Advanced Bash-Scripting Guide
7 Linux Newbie Admin Guide
8 LinuxSelfHelp
9 Getting Started with Linux

The above links and others can be found at 'Slackware-Links'. More than just Slackware® links!

"Knowledge is of two kinds. We Know a subject ourselves, or we know where we can find information upon it."- Samuel Johnson


XavierP 11-07-2010 07:03 AM

Moved: This thread is more suitable in Linux-Newbie and has been moved accordingly to help your thread/question get the exposure it deserves.

frankbell 11-07-2010 08:44 PM

Garrels: Intro to BASH scripting.


All times are GMT -5. The time now is 09:36 AM.