This is the first question in UNIX:
I was started shell script from 2 days before.
But I have a conflict: is a shell script a special programming language for a specific shell??
closed as not constructive by Gilles, Renan, warl0ck, jasonwryan, manatwork Nov 5 '12 at 8:42
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.
If you know of any command, say,
But, if you order a couple of such commands in a sequence, say A, B, C, D, and then put it (the sequence) in an executable file, you've got a program. The program has a name and location, so it can be referenced, and invoked; it has code, so it can be executed, one command at a time, by the CPU.
(The program is not compiled - like, for example, C source would have been - and this makes it a script. But it is a program nonetheless.)
That is, in some aspect, already at this point you are programming, because you are instructing the computer what to do.
Furthermore, you are, again at a very basic level, also using a programming language, because you can't just type anything (and expect it to work); at the same time, whatever you type you'll get activity from the computer that corresponds exactly to what you wrote.
There are rules how you should say things, and there are rules how the computer will react to those things.
That said, with "programming", you typically associate somewhat more expressive power than just piling commands on top of each other. At the very least, you'd like branching (
The shells have different languages, yes, but some may overlap to a great extent because of convention (why change a good way to say something?), or to be compatible with earlier versions (or some standard).
Bash is a
Scripts are typically quick and dirty. Say, a bash script to make your life easier. Whereas a 'programming' language is meant to be much more thought out and deliberate.The thing with 'programming' languages is that they are usually faster, and offer more control over low-level things if you want.
'programming' languages are typically used in scenarios where the code will be around for a long time. If you want to write something quickly and then never use it again, 'scripting' languages are what you want.
You can find an interesting article here.