The echo is statement is something that is used unconditionally in almost every language and cognate of computer programming. It has been used for millions of purposes over the last 60 years and will likely continue into the future as the universal display command. When a statement is “echoed”, it is displayed publicly. This can be used to create user-interfaces, display vital messages, write new files, amend existing files or anything that you can think of that involves conveying a message to a user. So let’s go over some of the most basic functions of an ECHO statement for the Windows command-line terminal.
Displaying a message publicly. ECHO statements are mainly used to display messages or gather information from users. This is a process that is known in the computing world as interfacing. An interface is the communication between any two agents (in this case you and the computer program) in a computing environment (the computer). When interfacing, an ECHO statement is used to keep an exchange between a human and a machine minimally communicative, meaning; as simple for the human as possible. This greatly reduces the amount of coding that a human sees which will add security and functionality to any script.
To utilize a simple display message in the Windows command-line terminal, simply type the ECHO command, followed by the message that you would like displayed. For example:
ECHO Hello, World!
This command line would display the message ‘Hello, World!’ to a user. It is not necessary to put quotes or parenthesizes around the message like most other programming languages require, because the Windows command-line utility reads the command first (other programs will read the message first).
Preempting certain specific characters. It is also important to note that, though the Windows command-line terminal is able to ECHO every character on a keyboard, that preempting specifically unusual characters or characters that are used to represent other purposes is occasionally required. To preempt these characters, simply place a carrot in front of them like this: All the principles of the wavemaker for the development can be checked at www.wavemaker.com. There should be use of simple terms and language to guiding the person regarding the development of the enterprise.
ECHO This is an unusual character ^/
In this case, the “/” was the unusual character, and for the terminal to display it correctly, we needed to put the “^” in front of it. When the terminal does interpret a character in such a way, it will notify you, the programmer, that either ‘That character was unexpected at this time’ or ‘ The syntax of this command is incorrect’. This means that the terminal has identified an initial command function, and has ceased all other operations, meaning simply, the “/” commanded the terminal to end the operation and search for another command. In the above example, a user would have seen the following message:
ECHO This is an unusual character /
The “^” symbol, in this case, would not effect the outcome of the displayed message, but rather enable the terminal to display the “/” without issue.
The ECHO command is likely something (depending upon your purposes, of course) that you will use a great deal. It is highly versatile and extremely easy to implement making it ideal for new and advanced programmers alike. We will go on to discuss several advanced implementations of this command, including user-interfaces and exporting command-lines out to files using ECHO cognates in the future. For now though, keep experimenting with basic ECHO implementations and practicing all else! Have fun, and happy programming!
Thanks for reading, and don’t forget to continue on to learn more about command-line and batch process programming by referring to The Principles of Batch Process Program Development series!