Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.

I am so lost !!!

Thread Tools Search this Thread
# 1  
I am so lost !!!

I am taking an online Linux class, which is mandatory for me to graduate. Unfortunately I got the worst online teacher ever, he never respond to any e-mails. I have no idea what going on in this class so I am turning to you guys.

Here is the questions for the week, Ok I don't expect anybody to just give me the answers. I want to learn the stuff so if you guys can just direct me to where I can find these answers and learn more basics cause we are using " A Practical guide to Linux by Mark G. Sobell" and I can't seem to make anything of it Smilie.
We are writing a midterm and a quiz this week and he didn't even tell us what material we have to cover. Waste of money if you ask me.

1. Here is a fragment from a shell script:

while who | grep robert >/dev/null

Which command's exit status (who or grep) will be used to determine if the while's condition is TRUE or FALSE?


2. What type of loop will execute all the commands between do and done as long as the loop's condition is FALSE?


3. What type of loop would be used if we wanted to execute a group of commands once for each item in a list?


4. Complete the following code fragment so it runs the commands between do and done on all files in the current working directory that start with an upper-case letter and have .c as the last 2 characters.

for _________________________________________
echo $x

5. Complete the if statement in this code fragment so it will print "Yes" if the variable named temp is set y and "No" if it is not. (hint: use the "test" commend)

if ______________________________________________________
echo "Yes"
echo "No"

6. Write a for loop to do the following: Assume we have a directory that has (amongst other things) the sections of a book we are writing stored in 10 files named section0, section1, ..., section9. We want to print to stdout each filename followed by the contents of the file for those (and only those) sections stored in section3 through section8 (inclusive). Write a for loop to do so.

7. Write a shell script fragment that contains a while loop that checks every 5 seconds (or so) to see if the user robert is logged in. As long as robert is logged in, the script should print to stdout (screen) Bob's still logged in! Once robert logs out it should print to stdout Bob just logged out! Make sure to send any unwanted output to the null device (bit-bucket) so it doesn't show up on the screen.

8. Assume we have a script named p1 with the following contents:

echo $#
echo $2 $1
echo $*
ls /zzxxwqsaer 2>/dev/null >/dev/null # /zzxxwqsaer does not exist
echo $?

What is the exact output if we run the script with the command line p1 Bob Leslie Sarah?

9. Finish the shell script fragment so it gets input from the user and stores it in a variable called choice, then uses a case construct to run who | more if a or A is chosen, ps x if b or B is chosen, and w | more if c or C is chosen. DO NOT use a default case.

while :
echo "A - Who's logged on"
echo "B - List all my processes"
echo "C - List everyone's current process"
echo "Enter choice:\c"


10. What is the purpose of the colon (Smilie after the while in the above script fragment?

It's a special condition that means "Always True"

Thread Tools Search this Thread
Search this Thread:
Advanced Search

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Lost my Way

I want to execute my own utilities from my bin folder without having to specify paths at run time - i.e. just enter name on command line - to do this my search path needs to be set up at login time - when I do this the path is not getting set right apparently(?) - PATH echos OK but the search... (0 Replies)
Discussion started by: robert stansel
0 Replies

2. UNIX for Dummies Questions & Answers

I am so lost...

I have been using linux now for about 6 months. I like it although it was quite a learning process. Pretty simple for the most part. Here is my prob... The first time I installed linux on my computer it went in just fine, no problems. It did eventually crash though and I had to re-install it.... (2 Replies)
Discussion started by: Treb
2 Replies

3. UNIX for Dummies Questions & Answers

Lost with terms

Hi all,in the midst of downloading rpm and various flavors of unix, i encountered some architecture terms and i am confused. Would anyone be kind to enlighten they mean in the world of unix? term: meaning i386: x86_64: IA32: IA64: AMD64: bin: src: (3 Replies)
Discussion started by: new2ss
3 Replies

4. UNIX for Dummies Questions & Answers

I'm so lost...

Fair warning... I know nothing of Unix. That's why I joined this forum and I need your feedback desperatly. Here is the situation... I built an app using ASP and Northcode's SWF Studio v3 for a cd launcher tool for a client that develops software. They like the app and it works well on... (2 Replies)
Discussion started by: daJabberwocky
2 Replies

5. Filesystems, Disks and Memory

Lost Data Lost Admin

First time so excuse my ignorance please. I may not be accurately describing the issue. I have inherited a small lab mostly SUN V120s. We lost power and are trying to recover. Nope no backups... The primary issue I have is 1 box is an Oracle Server. It has 2 36Gb harddrives. I am able to... (3 Replies)
Discussion started by: murphsr
3 Replies

6. UNIX for Dummies Questions & Answers

So lost

I have been reading up on starting a website, but i am still lost. I am in much need of assistance. Kind of a step by step because i still don't know where to start. please help. thank you (1 Reply)
Discussion started by: sweetie020602
1 Replies

7. AIX

lost errlog

Hi, i have a problem with mi Aix system, the errlog file is initialized to 0, and i can't write in it, when i run the errpt teh error 0315-180 logread: UNEXPECTED EOF 0315-171 Unable to process the error log file /var/adm/ras/errlog. 0315-132 The supplied error log is not valid:... (2 Replies)
Discussion started by: gonmeres
2 Replies

8. Programming

Packets Getting Lost

I am working on a project, which has the following type of hardware setup. A special hardware device is receiving data from an external network interface. So we can have multiple such a hardware devices. Now these hardware devices will route the captured incoming data through the external... (4 Replies)
Discussion started by: S.P.Prasad
4 Replies

9. Shell Programming and Scripting

lost again

will this script work? I want to use it in unix. clear ans='y' While test $ans='y' do notfound() { echo $response " is not logged in" } found() { echo $response "is logged into " $name } name=`ps -eaf | grep "\<$response\>" | cut -b 80-85` if ; then name=`rsh server2 ps -eaf... (7 Replies)
Discussion started by: azman
7 Replies

Featured Tech Videos