Re: Writing a shell program in C




souissipro wrote:
Hi L7,

In fact it's for an asignment for school and I should do it. Therfeore,
if you have a C shell that does what is listed in my email or you know
a link to something similar It would be of great help for me.

Then, I'm sorry, but I can not provide you with an answer. One of the
most rewarding aspects of education is the fact that you conquer it
yourself.


I would repeat: I'm looking for a C shell that does the functionlities
I have mentionned. A simple undesrtandable shell !!


As I mentioned, what I have is ruby, and the result is understandable
enough (and in C), but there is _no_ functionality.

Thanks a lot,

Souissipro


The links provided will give you plenty to draw from.
Good luck.


L7 wrote:
souissipro wrote:
Dear ALL,

I'm C and shell beginner and I should write a sheel that does the
following:

By 'should', do you mean that this is an asignment for school or that
you would like to learn by trying this as an exercise?

- reads an input line from standard input, parses the line into
commands and arguments, calls the command with the arguments and waits
for it to terminate.
- includes i/o redirection, environment variables, parameter and
command substitution, command line editing and filter management.


There are fully functional shells out there already. There is no reason
to 'reinvent the wheel'.
If you mean that you need to design this type of behavior, are you
willing/permitted to use the underlying shell to do the work for you?

I would greatly appreciate if anybody could provide me with a shell
that has the functionalities mentionned above and that I can start with
my learning?

As mentioned, there are other shells out there. However, if you are
looking to design your own, I have a ruby script that will take a
config file of required commands and produce a compilable C program
with only the actions of the commands to be filled in. The 'shell' will
already be created, you will just have to create the code for each
function.


Thank you very much for your help,

souissipro

.



Relevant Pages

  • Re: Redirection issue
    ... 1- execute input commands from standard input, ... code to implement the redirection it does not work anymore. ... And it's not good shell behavior to echo commands anyway. ...
    (comp.lang.c)
  • Re: Redirection issue
    ... 1- execute input commands from standard input, ... the phrase "it does not work anymore" carries very little meaning. ... after compilation and execution of the shell with a simple command like ...
    (comp.lang.c)
  • vulnerabilities in scponly
    ... without allowing shell access. ... scponly makes no effort to verify the path to the scp or sftp-server ... arbitrary commands by simply uploading a file. ... However, if this is *NOT* the case, the user could execute arbitrary ...
    (Bugtraq)
  • Re: Redirection issue
    ... 1- execute input commands from standard input, ... "does not work" could be anything from not compiling, not executing, ... after compilation and execution of the shell with a simple command like ...
    (comp.lang.c)
  • Re: PYTHONPATH
    ... The error indicates the shell tried to execute a program named '1' and couldn't find one. ... Arthimetic expressions generally have to be wrapped in ) in bash: ... non-interactive shell with the --login option, it first reads and executes ... commands from the file /etc/profile, ...
    (comp.lang.python)