Results 1 to 8 of 8
when a command is enterted how does it display the output on screen..... what is the internal working???...
- 05-26-2009 #1Just Joined!
- Join Date
- Apr 2009
- Posts
- 18
command execution
when a command is enterted how does it display the output on screen..... what is the internal working???
- 05-26-2009 #2
I assume commands are nothing but C program, These executable are place under specific path.when a command is enterted how does it display the output on screen..... what is the internal working???
Example : main,c
Compile itint main(){
printf("\n Linux Programmers Paradise\n");
return 1;
}
move to pre-defined pathgcc -o main main.c
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
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 05-27-2009 #3Just Joined!
- Join Date
- Apr 2009
- Posts
- 18
- 05-27-2009 #4
e.g. if i typed
$ echo hello
hello will be displayed,compile it asint main(int argc,char * argv[]){
printf("%s",argv[1]);
return 1;
}
gcc - echo2 main.c
Run it as
./echo2 hello- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 05-27-2009 #5
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- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 05-28-2009 #6Just Joined!
- Join Date
- Apr 2009
- Posts
- 18
- 05-28-2009 #7
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- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 05-28-2009 #8Just Joined!
- Join Date
- Apr 2009
- Posts
- 18


Reply With Quote

