Welcome to the Linux Foundation Forum!

echo

can anyone plz tell me how does echo command display a text... i mean what is its internal working?

plz gv me source code for echo command...

thank you.... waiting for reply....

Comments

  • bproffitt
    bproffitt Posts: 8
    You should be able to get to the source code of echo within the source code of whatever shell you are using.

    BKP
  • masinick
    masinick Posts: 20
    The echo command simply writes output to what is called standard output (stdout), although like many other commands, output can easily be redirected to a file or a device.

    As noted, the source code for echo ought to be readily available anywhere you get a binary distribution, because one of the stipulations of making the software available is that the source code must be redistributed as well.
  • kvit
    kvit Posts: 1
    Some Linux/Unix commands are "external" programs/scripts/applications/etc from the shell and others are part of the shell. The echo command is part of the the shell and is an "internal" command.

    "echo" is also included as an external command into GNU coreutils and may be different from the shells echo
    $ dlocate /bin/echo
    coreutils: /bin/echo
    $ LANG=C /bin/echo --help
    Usage: /bin/echo [OPTION]... [STRING]...
    ---------------8<-------------------
    NOTE: your shell may have its own version of echo, which usually supersedes
    the version described here.  Please refer to your shell's documentation
    for details about the options it supports.
    
    

Categories

Upcoming Training