Log in

View Full Version : Why "echo?" (origin)



djr33
09-27-2006, 10:33 AM
Just out of curiosity, why does php (and now I've noticed batch files too) use "echo" as the command to output text.
It kinda makes sense, but certainly less than print, output, write or any other number of commands would.

mwinter
09-27-2006, 11:16 AM
Just out of curiosity, why does php (and now I've noticed batch files too) use "echo" as the command to output text.

I don't know exactly, but I should think that it originates from "echo mode" in terminals. When data is sent to a server, the server "echoes" the data back to the terminal.



It kinda makes sense, but certainly less than print, output, write or any other number of commands would.

Agreed.

Mike

Twey
09-27-2006, 05:33 PM
It makes sense when executing the script interactively, as the script will literally "echo" back the parameter(s) to the user.

mwinter
09-27-2006, 06:50 PM
It makes sense when executing the script interactively, as the script will literally "echo" back the parameter(s) to the user.

That's quite a stretch. If what the user sees is only an echo, where's the original being sent?

Echo mode (which in batch files is also controlled by the echo command) is all about replaying the commands sent to the shell, so it's a sensible name. Another command name could easily have been used for displaying messages.

Mike

Twey
09-27-2006, 07:10 PM
Hmm?

$ echo Some text
Some textOriginal in red, echo in green.

mwinter
09-27-2006, 07:15 PM
Hmm?

$ echo Some text
Some textOriginal in red, echo in green.
That's not what I asked (and it was a rhetorical question, at that), nor is it echoing. Repeating the entire line, command included, would be, as that is what's being sent to the command interpreter.

Mike

djr33
09-28-2006, 08:39 AM
I've spurred a debate!
//watches.

Yeah... I can see why it kinda makes sense, as I said before, but just not sure who would've thought of that as the name for it. But the echo mode thing makes sense (though, who named echo mode? ;) )

tech_support
09-28-2006, 08:51 AM
"Echo" is a city you know. :D

djr33
09-28-2006, 09:33 AM
And a car. Perhaps programming just a marketing scam.
Next, we'll be using the honda command to connect to a database, and the ford command to duplicate a string....
I need sleep...