Find the answer to your Linux question:
Results 1 to 8 of 8
when a command is enterted how does it display the output on screen..... what is the internal working???...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2009
    Posts
    18

    Post command execution


    when a command is enterted how does it display the output on screen..... what is the internal working???

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,758

    Smile

    when a command is enterted how does it display the output on screen..... what is the internal working???
    I assume commands are nothing but C program, These executable are place under specific path.
    Example : main,c
    int main(){
    printf("\n Linux Programmers Paradise\n");
    return 1;
    }
    Compile it
    gcc -o main main.c
    move to pre-defined path
    mv main /usr/bin

    Now open any terminal and run the "command" called main.If You upload this "main" command to sites like sourceforge.net.If people find the software useful ,they will download your program and use it.

    That's how open source works
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  3. #3
    Just Joined!
    Join Date
    Apr 2009
    Posts
    18
    Quote Originally Posted by Lakshmipathi View Post
    I assume commands are nothing but C program, These executable are place under specific path.
    Example : main,c

    Now open any terminal and run the "command" called main.If You upload this "main" command to sites like sourceforge.net.If people find the software useful ,they will download your program and use it.

    That's how open source works
    thanx, but my question is different, i wanna know how does a OUTPUT display on SCREEN

    e.g. if i typed
    $ echo hello
    hello will be displayed, how this happens........

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,758

    Exclamation

    e.g. if i typed
    $ echo hello
    hello will be displayed,
    int main(int argc,char * argv[]){
    printf("%s",argv[1]);
    return 1;
    }
    compile it as
    gcc - echo2 main.c

    Run it as

    ./echo2 hello
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  5. #5
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,758

    Exclamation

    By fault screen is your output device - Keyboard is your input device

    if you want know about how printf() works then i would suggest to check with some system programming books like rebecca thomas Unix Programmer Guide
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  6. #6
    Just Joined!
    Join Date
    Apr 2009
    Posts
    18
    Quote Originally Posted by Lakshmipathi View Post
    By fault screen is your output device - Keyboard is your input device

    if you want know about how printf() works then i would suggest to check with some system programming books like rebecca thomas Unix Programmer Guide

    can u plz suggest me some links on internet........... i wanna know abt the internal working of eho command of linux.

  7. #7
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,758

    Smile

    If you want to know about working for echo ,then better check its source code with coreutils.

    echo source code :
    http://www.google.com/codesearch/p?h...utils%20lang:c

    coreutils download page
    Coreutils - GNU core utilities

    All the best
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  8. #8
    Just Joined!
    Join Date
    Apr 2009
    Posts
    18
    Quote Originally Posted by Lakshmipathi View Post
    If you want to know about working for echo ,then better check its source code with coreutils.

    echo source code :

    coreutils
    All the best


    thankyou very very much for the links........ if u know more abt echo then send me the updates.

    thanx again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •