internal working of echo command
can i know how does an echo command works internally. offcourse it is generally used to print a msg. how does it calls the msg
|
1/ Why would you need to know this?
2/ I'm sure you can dive into the sources - typically by getting a copy of the "developer" release of the package that contains your "echo". 3/ Which Linux distribution are you running? |
reason for knowing the internal working of echo command
sir actually i am under going a training on linux. In which we were asigned tasks. the question which i asked is one of my task and can't find a proper answer for this question on net. I would be thank full if u can help me with this task.
|
These Forums are not the right place to assist with homework or similar tasks.
Pay attention to the course and you will find the answer... |
When you write "how does it calls the msg" do you mean "where does it get the message from" or "where does it output the message to"?
|
Quote:
Code:
strace echo |
Quote:
|
Quote:
|
Quote:
Code:
type echo Code:
execve("/usr/bin/echo", ["echo", "$"], [/* 30 vars */]) = 0 |
Quote:
I didn't pay attention to the line pointed out by u due to my absent-mindedness :D |
for both
|
Quote:
|
mean "where does it get the message from" or "where does it output the message to"?
|
It gets the message from the command line and sends it to stdout. Here's from echo's man page
Code:
DESCRIPTION |
Quote:
e.g: Code:
echo "mohit_parihar" >> /home/mohit/Desktop/temp.c |
All times are GMT -5. The time now is 12:21 PM. |