Homework questions, book is lacking answers?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Homework questions, book is lacking answers?
# 1  
Old 10-20-2010
Question Homework questions, book is lacking answers?

Hey you guys,

There's a couple questions I cannot find the answers to anywhere in this book for my Operating Systems class, hopefully you guys could help. I believe we are in the Bourne shell.


1. Match each description to the appropriate type of variable

Used in shell programs

Also called personal variables

Also called standard shell variables

Always completely capitalized


A. Environment variables
B. User-created variables
C. Positional parameters

2. Which of the following is the appropriate command to change the value of the environment variable PATH so it retains everything that was in it before, but so that it will have /scripts appended to the end of it?

PATH=$PATH:/scripts
$PATH=PATH:/scripts
PATH=$PATH + /scripts
$PATH=PATH + /scripts


3. You wish to run a script named myscript which is located in the directory /scripts. The directory is NOT contained in the PATH environment variable's value, nor do you wish to make it so. In order to execute the script, you could type the following on the command line:
___________ /scripts/myscript
# 2  
Old 10-20-2010
Hi,

These would be my answers:

1.-
Used in shell programs -> Positional parameters
Also called personal variables -> User-created variables
Also called standard shell variables
Always completely capitalized -> Environment variables

2.-
PATH=$PATH:/scripts

3.-
sh /scripts/myscript

But not sure.

Regards,
Birei

Last edited by birei; 10-20-2010 at 05:18 PM.. Reason: Incorrect execution of script using bash instead sh
This User Gave Thanks to birei For This Post:
# 3  
Old 10-20-2010
sh not bash.

I think the capitalization is traditional, might even be a recommended style, like "capitalize anything exported and not, not". In this usually case sensitive world, to hit old ones (PATH, HOME, SHELL, etc.) you must capitalize, but new ones can come into existence that are not capitalized. export makes not discriminate. The ones recognized by the kernel are probably all capitalized! It is good to know which names have extra magic.

Last edited by DGPickett; 10-20-2010 at 04:04 PM..
This User Gave Thanks to DGPickett For This Post:
# 4  
Old 10-20-2010
Well, when it comes to the capitalization, would you recommend something outside or what Birei suggested (within the answers allowed, obviously)?

Thanks for the quick responses though!
# 5  
Old 10-20-2010
In school, the professor sets the right answer and reality is suspended. You knew that!

Make sure you say sh for Bourne not bash, unless the prof says bash stand for Bourne Shell.
# 6  
Old 10-20-2010
I will, thank you.

One more question for ya, with my Mac, I can't open the Unix file that she'd allow to download if I had a PC so I can't figure these out. I tried in terminal, but I don't trust it. The only one I got to work was Kabul.


select all the words listed below which look recognizes as valid.

Serendipitous
Kabul
Obama
Ichthiology
# 7  
Old 10-21-2010
Quote:
Originally Posted by KyleBucket
I will, thank you.

One more question for ya, with my Mac, I can't open the Unix file that she'd allow to download if I had a PC so I can't figure these out.
what UNIX files were these? And what is a "UNIX file", anyway? An archive you don't know how to extract, or a script you're having trouble running? OSX uses BASH too. In what way are they not behaving?
Quote:
I tried in terminal, but I don't trust it.
If by "unix file" you mean "shell script", shell scripts work in nothing but terminal in OSX. You can't double-click them.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. What is on Your Mind?

Answers to Recently Asked Questions about UNIX.COM

Here are some answers to some of the recent questions I have received about UNIX.COM. So, I thought I would take time to answer them here in this post: Is it expected that the original poster "thank" everyone who responds to his / her discussion thread? It is always a good practice in all... (7 Replies)
Discussion started by: Neo
7 Replies

2. UNIX for Beginners Questions & Answers

Answers for few objective questions.

Hi Unix geniuses, I need your help for the answers of few objective Q&A. i dont know if my answers are correct or not. So i really need your help to provide the answers which will help me in unix programming. (1 Reply)
Discussion started by: Vivekit82
1 Replies

3. Shell Programming and Scripting

Select answers from multiple questions using shell script

I have a text file in this format Some lines.... Question no: 1 The question? A. Answer 1 B. Answer 2 C. Answer 3 D. Answer 4 Answer:B Some lines.... Question no: 2 The question? (choose 2) (10 Replies)
Discussion started by: zorrox
10 Replies

4. UNIX for Advanced & Expert Users

Interview questions and answers on HP Unix administration

Hi, Can some body help me to get Interview questions and answers on HP Unix administration? Thanks Krsnadasa (1 Reply)
Discussion started by: krsnadasa
1 Replies

5. Post Here to Contact Site Administrators and Moderators

Eric's Questions and Answers Blog

I hope this is ok so I will ask if I may use this thread to ask questions about programming. May I use this thread to ask questions and answer questions? If the answer is yes, this is a thread made for minimizing the amount of threads I post to ask questions about programming. Please feel... (3 Replies)
Discussion started by: Errigour
3 Replies

6. Solaris

Please give answers for this interview questions

I was not able to get answers for these interview questions. It will be appreciable and useful if any one answers this questions. (5 Replies)
Discussion started by: Sesha
5 Replies

7. Solaris

solaris 10 OS administration interview questions and answers

Hello, I am new to this forum and I am preparing for interview .Kindly can anybody send me Solaris 10 OS administration interview questions and answers (2 Replies)
Discussion started by: meet2muneer
2 Replies

8. Solaris

expecting answers for these questions?

hi all plese clarify me in the following area. 1. What is the default NFS version in solaris 5.10. If it is 3, then why it asks me to specify "-o vers=3" keyword while i am mounting a share from a RHEL 5.1 Server? 2. Can someone give the link to download packages for accessing "ntfs"... (4 Replies)
Discussion started by: kingston
4 Replies
Login or Register to Ask a Question