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.
What does the simulation do exactly? What platforms does it target? If it is supposed to be a piece of software as sophisticated as say, GNU bash, it is unlikely that someone could just whip one up for you from scratch. The shell may just look like "$", but it is a pretty impressive program with a boatload of documentation that has been refined over a period of years.
Not trying to be a jerk... It sounds to me like it's a programming assignment. I ran across at least one class in college that assigned a program description such as:
Write a basic command interpreter.
The program should present the user with an opportunity to enter commands, process them, and wait for the next command.
Your program will need to parse the command line to determine the command and argument(s).
The commands that must be supported are:
etc.
So, there are three things I see that will prevent anyone from posting a "solution". First, it sounds like homework.
Second, nobody is receptive to "I can't do it, so do it for me" requests. If you want help, the traditional approach is to post the code you have, explain what's not working, and identify what's been tried to fix it.
Lastly, the foundation of any shell is simply a loop: read input from the user, parse, take appropriate action, get input from the user. It's not tough. That's not to say bash is simple, but it follows the same premise. The OP can always download the source code to bash and snoop around if ideas are needed.
I agree with Dark_Helmet, no one is going to do it for you, post up the relevant lines of code that are causing the errors, along with the errors, explain what you are trying to do and what you have done already to try and fix the problem - you will get a much more helpful response
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.