I currently got the task of programming a UNIX Shell for practice. The functionality is as follows:
1. Entering commands with the keyboard. Enter stops the input and creates a process which should start any program
2. the shell waits for termination of each command before another command can be accepted
3. parameters should be extracted and correctly delivered to the specific programm
4. "logout" ends the shell (more of that later)
5. commands which have an '&' appended should be executed in the background. new commands can be entered thereafter
-> commands are not to be hardcoded
6. entering CTRL-C should deliver the currently running foreground process the signal SIGINT (not the shell)
7. entering CTRL-Z should deliver the currently running foregruond process the signal SIGSTP
8. implement a command "fg" that brings back a process back to the foreground which has been stopped by CTRL-Z
9. implement a command "bg" that lets a stopped process (by CTRL-Z) run again in the background
10. the shell can only be terminated if all background processes have been terminated, else give an error message, and make sure there should not be any zombie processes
I already started doing some of the tasks but I'm terribly unsure of how to exactly handle processes, it's very new to me. I would be delighted if someone could give me a more or less simple solution, so I can get the picture of it.
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.
Please review the rules, which you agreed to when you registered, if you have not already done so.
More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.
1. The problem statement, all variables and given/known data:
Hello! :)
I currently got the task of programming a UNIX Shell for practice. The functionality is as follows:
1. Entering commands with the keyboard. Enter stops the input and creates a process which should start any program
2.... (0 Replies)
Guys,
What do you think is the best way to learn UNIX and shell scripting?
** I keep on searching tutorials online, where I loose most of my time :(
Let me know the way you learnt the UNIX concepts, your replies might help me learn more.
Thanks a ton:b: (2 Replies)
Hi guys
i have two different line
input
M5.7&a : M5 minimum density is 20%, maximum density is 80%,
DENSITY PERM=M5.8&a(180) ......... 6 violations found.
M6.7&a : M6 minimum density is 20%, maximum density is 80%,
DENSITY A=M6.8&a(180) ......... 6 violations found.
need... (2 Replies)
Hi Gurus
I am very new to Unix Shell Prog. I have a file in format
Q1 Dirname-FileName Score Remarks
i.e. containing columns separated by space. I want to read Column 1 and 2 and then join them to make a string that would be a path to a file. I will use this string to fetch the files and... (4 Replies)
Hi,
I am looking for a PDF or an e-book which can show in details how to do Shell Scripting or Programming. Can anybody provide me with a link to such a tutorial? I have downloaded some tutorials but they show only basics and not give any in-depth study material.
I am using Red Hat Linux... (2 Replies)
Hi,
i want to read a full file.
If i want to split the file and by reading parralel each, i can save the time.
Can any body give me the suggesion??
ia m using this function to read a file and using that i have to grep in another file. since the file 1 is huge it is taking lot of time.
... (3 Replies)
Hi,
Iam using split command to split the files.
Splitted files will be named as xaa
xab
xac
xad etc.
Directories will be test1,test2,test3.....
Now i want to select the splitted files one by one and have to place in test directories.
can anybody give the soulution??? (2 Replies)
Hi all,
Can anyone provide me any checklists or a list of steps I should follow before executing my scripts.
Could also tell me if there are any other standards to be followed while shell programming like naming conventions for variables etc.
Your help would be much appreciated.
Regards,... (2 Replies)