On 7/27/07, Sameer Oak <[EMAIL PROTECTED]> wrote:
> Where can I find source code of "echo" command?

Here's a minimal echo that does not handle options (-n, -e, etc.)

int main(int argc, char *argv[])
{
  int i;
  for (i = 1; i < argc; i++) printf("%s ", argv[i]);
  printf("\n");
  return 0;
}

echo command is nothing but printing of its arguments.

Note: above program not tested. Also has an obvious bug: prints an
extra space at the end if it has 1 or more arguments (I just wanted to
keep it simple).

-- 
Vaibhav

--
______________________________________________________________________
Pune GNU/Linux Users Group Mailing List:      ([email protected])
List Information:  http://plug.org.in/cgi-bin/mailman/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.

Reply via email to