Mini Shell in C

Hi Everyone,
I am a student learning C and Unix. I want to create a shell in C
which accepts command line arguments and executes them.
I am not sure how to do this. Any help would be greatly appreciated.
Thanks

Have you ever hear something about system() ? :slight_smile:

A couple of days back, I came across an URL wherein, someone actually posted the source code for a shell he wrote in c++.

That could be a good starting point for you. But if you use that as your point of beginning, then you would be biased to think in the same way he does.

But for pure learning purpose, I shall paste the URL here.

http://www.bloggerman.com/articles/2003/November/shell

Beware tho', if the moderators think this reply is in violation of the 'homework rule' they will remove it.

Best regards,
Vino

This remark was for me? :mad:

Not at all intended for you.

What I meant was if my reply, in which I posted the URL, is a violation of the 'homework rule' i.e.

(6) Do not post classroom or homework problems.

then the administrators/moderators could possibly delete the post.

The o/p needed some help with creating a shell in C. It could be an assignment. And my post gives you the answer directly. And hence, that will raise the `violation interrupt`. :stuck_out_tongue:

Cheers :slight_smile:
Vino

We do have some rules here and we expect everyone to follow them. One of the rules is:

(6) Do not post classroom or homework problems.

If you suspect that a question violates this rule, please don't answer it anyway. This encourages further rule violations.

At this point passat, if he waited for years, knows how to download the source code for a shell. I guess what he wanted, but that's not the same thing as creating the source code for a shell.

Answering a 4 year old question is a bit odd, but I guess I'll leave the thread open.