Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent Help: Shell Script

Status
Not open for further replies.

arjagadish

Technical User
Jan 6, 2003
36
IN
These are the Questions I might face in of our exams. Some of u might think these questions are simple(trust me for a Windows Oriented Guy and a novice on Linux like me it's tough). So any help on this would be appreciated.

Q1] WRITE A PROGRAM WHICH ACCEPTS AN INTEGER AND DISPLAYS WHETHER IT IS ZERO, ODD OR EVEN

Q2] WRITE A COMMAND IN SHELL SCRIPT WHICH DISPLAYS THE /etc/passwd FILE IN UPPER CASE AND CONVERTS ALL ":" DELIMITER INTO TAB

Q3a] WRITE A COMMAND WHICH DISPLAYS INFORMATION ON A COMMAND ALONG WITH ITS USAGE

Q3b] WRITE A COMMAND WHICH SUSPENDS THE EXECUTION OF A PROCESS FOR A PARTICULAR DURATION

WRITE A PROGRAM WHICH SORTS THE /etc/passwd file AND STORES THE RESULT IN A FILE file1

WRITE A COMMAND TO SEND MESSAGE TO A USER LOGGED ON FROM A TERMINAL

WRITE A COMMAND TO DISPLAY THE TERMINAL NUMBER FROM WHICH YOU HAVE LOGGED
 
firstly:
faq333-2924

secondly:
what do you have so far? vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Well, I'm not asking anyone to do anything illegal or do my assignments.

I just wanted to cross-verify few of the scripts.

I don't have answers for Q3a & Q3b and for the one where it asks how to send a message to a user logged on from a terminal.

Remember, this is no way related to any of my assignments.
 
I'd say 3a is covered by man <command>, whilst 3b is probably sleep <seconds>.

As far as sending a message to an individual user is concerned, you can use write user [terminal]

To write to all users, use wall

HTH
 
A good book is The Unix C Shell field guide by Gail Anderson and Paul Anderson.

!!!Do some reading, it will help in the long run, you cant expect us to do your assignment (dirty work)!!!!!.

I am going to go lie on a beach and drink plenty of alcohol.
:D
 
interesting........ I didn't see any posted scripts to &quot;scross verify&quot; with.

3a) what I usually do is to implement a '-u' [usage] switch for all of my scripts. Writting a command line parser for the script and display a 'usage' clause for the script is what you need. Take a look at the 'getopts' [man getopts] or write your own command line parser [while, case, shift].

3b) as somebody has already mentioned look into 'sleep'

For the rest, post what you have so far and somebody will 'cross reference' it. vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top