Hey guys,
Could you help me with this particular program, say, named wsh (wimpy shell) that reads commands from standard input, executing them one at a time. After starting the process to run a command, wsh waits for the process to complete before processing the next command. For example, the input:

% vi fork.c

% make

% wsh

would invoke the vi editor on the file fork.c, run make after vi completes,
and finally invoke wsh itself.

After executing a command, wsh should display statistics that show some of
the system resources the command used. In particular, wsh should print:

1. The amount of CPU time used (user, system, and total time).

2. The number of times the process was preempted involuntarily.

3. The number of times the process voluntarily gave up the CPU.

The following system calls might be useful:

fork - create a new process

getrusage - get information about resource utilization

execvp - execute a binary file

wait - wait for a process (or processes) to terminate

Recommended Answers

All 3 Replies

>Could you help me with this particular program
Your question asks for help yet the rest of your post implies that you expect us to do it all for you. Try again.

I wasn't clear in my posting...i would appreciate if you could do it for me!!

thanking you in advance,
jason

>i would appreciate if you could do it for me!!
Sorry, but I refuse. My reasons are as follows:

1) This is your program, not mine. I don't care about it at all.
2) Writing a shell is an amazing learning experience. If I did this for you then you would miss out on a lot of useful knowledge.
3) I've already written a shell that was much more fully featured than this one. I've solved the problems that arise and gained valuable experience in the process. There's no need for me to do it again, but it would be beneficial for you to do it.

If you need help with any part of it, I'll be glad to offer advice. But I'm not going to do it for you, and nor will anyone else you ask.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.