[PLUG] source code of echo command...

Shantanoo Mahajan shantanoo at gmail.com
Tue Jul 31 10:27:15 PDT 2007


To start with I would like share following link:
http://www.caliburn.nl/topposting.html

On 31-Jul-07, at 9:23 AM, Sameer Oak wrote:

> 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

Apart from the freebsd's source you may try:
http://www.google.com/codesearch?q=echo

regards,
shantanoo




More information about the plug-mail mailing list