LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-02-2010, 07:49 PM   #1
too beginner
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Rep: Reputation: 0
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.
 
Old 11-02-2010, 08:17 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,393

Rep: Reputation: 1652Reputation: 1652Reputation: 1652Reputation: 1652Reputation: 1652Reputation: 1652Reputation: 1652Reputation: 1652Reputation: 1652Reputation: 1652Reputation: 1652
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.
 
Old 11-03-2010, 06:46 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 12,616
Blog Entries: 26

Rep: Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988
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

 
Old 11-07-2010, 07:03 AM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Moved: This thread is more suitable in Linux-Newbie and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 11-07-2010, 08:44 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 11,809
Blog Entries: 13

Rep: Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948
Garrels: Intro to BASH scripting.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 04:21 PM


All times are GMT -5. The time now is 02:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration