UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 11th, 2006, 10:07 AM
spezialize spezialize is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 218 spezialize User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 10 h 21 m 15 sec
Reputation Power: 4
Some unix hw help

Hey guys. A little stuck right now. I am taking a side class trying to learn basic unix. If anyone could help me out and walk me through this id very much appreciate it.

here is the question

I believe this should be done using Cshell

1. write c program or script that sleeps for 15 minutes
( i believe issuing the sleep command will work)
2. issue ps command to show all the processes controlled by the terminal
3. Run the sleep script/cmd in the background
4.Issue ps command to show all proccesses controlled by terminal
5.mark the process running in the foreground and background
6. bring the background processes to the foreground
7. stop it using cntrl-z and issue ps command
8. Mark the status of all proccesses controlled by terminal
9. take the stopped processes to the background and issue the ps command
10. mark the process statuses
11. kill the background process and issue ps command.

im so confused

Reply With Quote
  #2  
Old April 11th, 2006, 02:52 PM
Ehlanna's Avatar
Ehlanna Ehlanna is offline
Not a clue what to put ...
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: in front of this keyboard
Posts: 815 Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 5 h 43 m 48 sec
Reputation Power: 243
I assume this is homework? Bloody good luck in getting #7 down on paper, LOL!

I would hope that by this stage in your course you would have been introduced to the man command, and given an introduction to basic command line usage.

Reply With Quote
  #3  
Old April 13th, 2006, 08:08 AM
spezialize spezialize is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 218 spezialize User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 10 h 21 m 15 sec
Reputation Power: 4
gee thanks. yes i used the man command. I was hoping someone could walk me through this stuff. unix is a interesting OS

Reply With Quote
  #4  
Old April 13th, 2006, 04:07 PM
Ehlanna's Avatar
Ehlanna Ehlanna is offline
Not a clue what to put ...
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: in front of this keyboard
Posts: 815 Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 5 h 43 m 48 sec
Reputation Power: 243
Ok, got that all sorted ... now:

1) Use the man page for sleep
3) try putting an ampersand after the command to put in batch ... command &.

2), 4) and 8) are to show the system before and during the batch sleep command.

6) man page for fg

And so on ...

Reply With Quote
  #5  
Old April 21st, 2006, 02:32 PM
spezialize spezialize is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 218 spezialize User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 10 h 21 m 15 sec
Reputation Power: 4
can anyone else help? im confused to bloody hell.

Reply With Quote
  #6  
Old April 24th, 2006, 08:22 AM
SimonJM SimonJM is offline
Contributing User
Dev Shed Novice (500 - 999 posts) Click here for more information
 
Join Date: Mar 2006
Posts: 764 SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 22 h 56 m 18 sec
Reputation Power: 336
Since you are being asked to run ps commands to look for specific things that will (or will not) be there all these 'questions' would be done whilst logged in to the server in question.

1) Simple enough - a script will be dead easy and I suspect a C program almost as easy (I do not know C!).

Code:
!/bin/sh
# Calculate how many seconds in 15 minutes
min15=$(( 15 * 60 ))
# Issue the sleep command
sleep $min15


Put that code in a script, make sure it is executable, and run it.

2) Now, and this will be annoying ... your session will lock whilst that command runs, so you will need to open up another session to to the ps in. Check the man page for what parameters you would need and/or for what info to look for.

3) Run the script from question 1) again, but put a space and an ampersand after the script name - that will put the command in batch.

The rest of the questions involve either a ps command to show/prove the command running or not running, the rest involve controlling the running of the script in batch and foreground - the man pages for fg, bg, and kill will give you a clue I trust.

Reply With Quote
  #7  
Old May 11th, 2006, 03:03 PM
Ehlanna's Avatar
Ehlanna Ehlanna is offline
Not a clue what to put ...
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: in front of this keyboard
Posts: 815 Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 5 h 43 m 48 sec
Reputation Power: 243
Quote:
Originally Posted by spezialize
can anyone else help? im confused to bloody hell.


Still confused? How did you get on with the assignment? Any special issues or problems you found in doing them?

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Some unix hw help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT