CLI source code? - Embedded

This is a discussion on CLI source code? - Embedded ; Hi, Does anyone know of any open source code for a Command Line Interpreter that I can use for an embedded linux system I'm currently working on. I can't that people keep writing this from scratch. Thanks in advance! Dave ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: CLI source code?

  1. CLI source code?

    Hi,

    Does anyone know of any open source code for a Command Line Interpreter that
    I can use for an embedded linux system I'm currently working on. I can't
    that people keep writing this from scratch.

    Thanks in advance!

    Dave M.



  2. Re: CLI source code?

    On Fri, 03 Mar 2006 00:19:41 -0500, David Medeiros wrote:
    > Does anyone know of any open source code for a Command Line Interpreter
    > that I can use for an embedded linux system I'm currently working on. I
    > can't that people keep writing this from scratch.


    Lots of people do write them from scratch: it's pretty easy. A loop full
    of if(strcmp()) statements over a strtok() loop is OK for many simple
    tasks. Or there's yacc/bison parsers if you need to get a bit fancier.

    If you want something pretty fleshed out, though, tcl, several scheme
    interpreters (eg guile) and several forth or forth-like languages (eg
    ficl) or lua, or even something really meaty like python or javascript
    have all been used. All have open-source implementations available.
    Several may already be there in your embedded linux system.

    How fancy do you want to get?

    Cheers,

    --
    Andrew


  3. Re: CLI source code?

    AFAIK, the system already separates the parameters of the command line
    when starting a program. I seem to remember that it even tries to assign
    handles to the files that are denoted by the first two parameters.

    But maybe I'm wrong.

    -Michael

  4. Re: CLI source code?

    In article ,
    "David Medeiros" writes:
    > Does anyone know of any open source code for a Command Line Interpreter that
    > I can use for an embedded linux system I'm currently working on. I can't
    > that people keep writing this from scratch.


    What exactly do you mean by command line interpreter -- a shell?

    If so, look at busybox: www.busybox.net

    HTH

    Rob

    --
    Robert Kaiser email: rkaiser AT sysgo DOT com
    SYSGO AG http://www.elinos.com
    Klein-Winternheim / Germany http://www.sysgo.com

  5. Re: CLI source code?

    In article ,
    Michael Schnell wrote:

    >AFAIK, the system already separates the parameters of the command line
    >when starting a program.


    It's the shell that does that.

    --
    http://www.spinics.net/lists/raid/

  6. Re: CLI source code?

    >
    >>AFAIK, the system already separates the parameters of the command line
    >>when starting a program.

    >
    >
    > It's the shell that does that.
    >



    I suppose that would help David. So he needs to find out how the shell
    provides this information (an array of pointers ?) to to program that is
    started.

    -Michael

  7. Re: CLI source code?

    Michael Schnell wrote:
    >>
    >>> AFAIK, the system already separates the parameters of the command
    >>> line when starting a program.

    >>
    >>
    >>
    >> It's the shell that does that.
    >>

    >
    >
    > I suppose that would help David. So he needs to find out how the shell
    > provides this information (an array of pointers ?) to to program that is
    > started.


    It is on the manpage:

    man 3 exec

    and, remember that the sub-process startup is on two
    phases in UNIX-like systems: fork() and exec().

    --

    Tauno Voipio
    tauno voipio (at) iki fi

+ Reply to Thread