[PLUG] source code of echo command...

Sameer Oak sameer.oak at gmail.com
Mon Jul 30 20:53:39 PDT 2007


Bingo,

Aditya, you've got that all right. I just refrained myself to counter query
to the suggestions to search the kernel code. Friends, FYI,
kernel really does not have to do anything with the shell built ins. I tried
to get the shell built ins but could not really find or rather could not
give enough time googling around for the same.

Besides this, Vaibhav, the code snippet you gave had thousands of flaws. I
don't really start enumerating them now. A hint for you, however, that code
doesn't say anything about STDOUT_FILENO and STDERR_FILENO (stdout and
stderr what commonly known as, one can find them in unistd.h). I
particularly wanted to see the way these file descriptors were handled by
echo.c
Anyway...

Aditya thank you so much for pointing my searches to BSDs. I had almost
forgotten, the same could very well be found in the BSD
locations.

- sameer oak.



On 7/28/07, Aditya Godbole <aag.lists at gmail.com> wrote:
>
> On 7/27/07, Dhiraj Khot <dhiraj at augusttechnologies.com> wrote:
> > Here is some information which should be useful for you:
> > There are two source codes for echo command (This can be verified using
> simple basic command type)
> > - Echo is a shell built in. So each shell has its own source code.
> > - If a shell does not have a echo command, then Kernel uses its own
> source code. > And I believe this should be similar to locating source code
> of any other
> > commands (like grep, etc). So should'nt be problem with that :)
> >
>
> Am I missing something here? What does the kernel have to do with the
> echo command?? Or any command for that matter.
>
> You should be able to get the source of echo built into the code of
> the shell, since it is a builtin shell command.
> Here is echo from the freebsd 'sh' shell.
> http://www.freebsd.org/cgi/cvsweb.cgi/src/bin/sh/bltin/
>
> Hope this helps.
>
> -aditya
>
> --
> ______________________________________________________________________
> Pune GNU/Linux Users Group Mailing List:      (plug-mail at plug.org.in)
> List Information:  http://plug.org.in/cgi-bin/mailman/listinfo/plug-mail
> Send 'help' to plug-mail-request at plug.org.in for mailing instructions.
>


More information about the plug-mail mailing list