|
Till now in our scripting series, we have talked about the regular expressions, commands, and file indirection. Let us now take an analogy. If a script can be compared to a human body and scripting to life, what we have talked, till now, are sense organs (making life more meaningful and powerful), heart (driving the life), and hands (giving the movement), respectively. So, then what is the brain of scripting - the logic part? Yes, it is none other than its constructs. Commands are the heart but we need the constructs to control them. And to assist them, we have the memory components called variables to store various information . Unlike the normal programming world, in the scripting world, we do not have a concept of type to variables. They are just free flowing. You may assign anything to them and interpret them the way you want. This promotes ease of expression. For example, XYZ=5324, XYZ="5234", XYZ='5234', all mean the same thing. To access the value in the variable, we write ${}. So, to print the value in the variable XYZ, we type: echo ${XYZ}. echo is an in-built shell command, which means there is no external executable for echo, but is part of the shell executable. Contrast it with say 'ls' or 'cat'. We will be discussing more advanced topics like built-in commands, in our forthcoming articles.
|