Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > Your Distro > Knoppix Help Forum > command execution

Forgot Password?
 Knoppix Help Forum   For all discussions about Knoppix, the Linux "Live CD" that lets you run Linux without needing to install on your hard drive.

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 05-26-2009   #1 (permalink)
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???
happy-linux is offline  


Reply With Quote
Old 05-26-2009   #2 (permalink)
Linux Engineer
 
Lakshmipathi's Avatar
 
Join Date: Sep 2006
Location: 3rd rock from sun
Posts: 1,093
Smile

Quote:
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
Quote:
int main(){
printf("\n Linux Programmers Paradise\n");
return 1;
}
Compile it
Quote:
gcc -o main main.c
move to pre-defined path
Quote:
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
-------------------
Lakshmipathi is offline   Reply With Quote
Old 05-27-2009   #3 (permalink)
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........
happy-linux is offline   Reply With Quote
Old 05-27-2009   #4 (permalink)
Linux Engineer
 
Lakshmipathi's Avatar
 
Join Date: Sep 2006
Location: 3rd rock from sun
Posts: 1,093
Exclamation

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

Run it as

Quote:
./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
-------------------
Lakshmipathi is offline   Reply With Quote
Old 05-27-2009   #5 (permalink)
Linux Engineer
 
Lakshmipathi's Avatar
 
Join Date: Sep 2006
Location: 3rd rock from sun
Posts: 1,093
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
__________________
- 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
-------------------
Lakshmipathi is offline   Reply With Quote
Old 05-28-2009   #6 (permalink)
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.
happy-linux is offline   Reply With Quote
Old 05-28-2009   #7 (permalink)
Linux Engineer
 
Lakshmipathi's Avatar
 
Join Date: Sep 2006
Location: 3rd rock from sun
Posts: 1,093
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
__________________
- 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
-------------------
Lakshmipathi is offline   Reply With Quote
Old 05-28-2009   #8 (permalink)
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.
happy-linux is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 09:33 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2