source code of shell commands - Linux

This is a discussion on source code of shell commands - Linux ; I would like to study some classic implementation of shell command like cp mv ... Where can find the source code?...

+ Reply to Thread
Results 1 to 8 of 8

Thread: source code of shell commands

  1. source code of shell commands

    I would like to study some classic implementation of shell command like
    cp mv ...
    Where can find the source code?

  2. Re: source code of shell commands

    Ronald wrote:
    > I would like to study some classic implementation of shell command like
    > cp mv ...
    > Where can find the source code?


    If you are running a rpm based system, you can use rpm to find out what
    package provides an executable.

    For example, the command "rpm -qf /bin/ls" will give the following
    result, coreutils-5.2.1-31

    This means that the command 'ls' is provided by the rpm package
    'coreutils'. A simple search of the web should be able to yield a
    source RPM for this package.

    Geoge

  3. Re: source code of shell commands

    George Huber wrote:
    > Ronald wrote:
    >> I would like to study some classic implementation of shell command
    >> like cp mv ...
    >> Where can find the source code?

    >
    > If you are running a rpm based system, you can use rpm to find out what
    > package provides an executable.
    >
    > For example, the command "rpm -qf /bin/ls" will give the following
    > result, coreutils-5.2.1-31
    >
    > This means that the command 'ls' is provided by the rpm package
    > 'coreutils'. A simple search of the web should be able to yield a
    > source RPM for this package.
    >
    > Geoge


    No, I don't use rpms. I'm using ubuntu now.

  4. Re: source code of shell commands

    Ronald writes:

    > George Huber wrote:
    > > Ronald wrote:
    > >> I would like to study some classic implementation of shell command
    > >> like cp mv ...
    > >> Where can find the source code?

    > > If you are running a rpm based system, you can use rpm to find out
    > > what
    > > package provides an executable.
    > > For example, the command "rpm -qf /bin/ls" will give the following
    > > result, coreutils-5.2.1-31
    > > This means that the command 'ls' is provided by the rpm package
    > > 'coreutils'. A simple search of the web should be able to yield a
    > > source RPM for this package.
    > > Geoge

    >
    > No, I don't use rpms. I'm using ubuntu now.


    Then you can use dpkg and apt-get. You an find out which package
    provides one of these commands with, for instance

    snowball:533$ which cp
    /bin/cp
    snowball:534$ dpkg -S /bin/cp
    coreutils: /bin/cp

    Now you can get the source with

    snowball:535$ apt-get source coreutils
    --
    Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
    Department of Computer Science FAX -- (505) 646-1002
    New Mexico State University http://www.cs.nmsu.edu/~pfeiffer

  5. Re: source code of shell commands

    Got it. Thanks.



  6. I'm reading both ``cp.c" of gnu's and openbsd's

    the former has the double size of the latter...

  7. Re: source code of shell commands

    On Wed, 27 Dec 2006 09:26:21 +0800 Ronald wrote:

    | I would like to study some classic implementation of shell command like
    | cp mv ...
    | Where can find the source code?

    For simpler source, google for "busybox".

  8. Re: source code of shell commands

    phil-news-nospam@ipal.net writes:
    > On Wed, 27 Dec 2006 09:26:21 +0800 Ronald wrote:
    >
    > | I would like to study some classic implementation of shell command like
    > | cp mv ...
    > | Where can find the source code?
    >
    > For simpler source, google for "busybox".




    The only sensible recommendation wrt Bustybugs is 'try to avoid it'.
    Especially, if you have a RAM constrained environment.


+ Reply to Thread