ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
to be able to recongnise and understand:
1. the use of systeam calls
2. how commands are interpreted in a UNIX like shell
3. the use of environment variables
procedure
Develop a simple UNIX/LINUX like Shell which satisfies the following requirments.
1. output a promt to the stdout (standard output).USe the '?' symbol as the promt.
2. The Shell must always wait for the previous command to finish before displaying another promt.
4.the command should be capable of accepting parameters.
a.E.g: ?ls-l
5.
a. fork a new process
b. The parant process will wait until the child get terminated
c. the child process will pharse the line of input to extract external command
d. the child process will interpret the first word in the input string as the
external command and should check whether the file name is existing
e. the location of the desired program can be identified by looking at the path
variable for given program
f.if the filename exist the child will execute the filename using systeam calls such as
execve,excepl,execv,execvp,etc.(you may need to find the most appropriate systeam call for your shell).
g.after the child terminate the parent resumes its operation and ready to accept another command
6. shell should bsupport cd and pwd internal commands
a.you may use the echo $PATH and $PWD commands to get values of above variable.
b.you may also use the gentenv and setenv procedures.
7. NO need of supporting input output redirection or piping.
8.the shell should intrrupt (stop) when Ctrl+D is pressed
Yeah, there probably is someone that can do it. You're supposed to "be able to recognise and understand" that list of things. How is getting someone to do it for you going to help you with that? If you're stuck on something and need help, give info about what it is you need help with. Please don't ask people to do work for you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.