Introduction
Is a program that works to receive commands from you and then ask the kernel to execute these commands. Ie acts as an intermediary between you and the operating system or in other words it represents the outer layer or interface of the system, it takes orders from you and gives you the result. Then it shows the inductor again, indicating termination, and waiting for you to enter more commands. This is why the shell is called a command interpreter, which is similar to command.com in windows. It also contains a programming language similar to high-level languages is very strong through which you can solve any problem you face.
What is shell propmt?
The inductor, whether it is% or $, depends on the type of shell you are using.When the prompt appears, it means that the shell is waiting for you to type the commands to execute.If you have entered the system as the root of any system administrator, the prompt will appear.
What is shell propmt?
The inductor, whether it is% or $, depends on the type of shell you are using.When the prompt appears, it means that the shell is waiting for you to type the commands to execute.If you have entered the system as the root of any system administrator, the prompt will appear.
The following are the advantages and disadvantages of each type of shell quickly: The first type includes: The Bourne shell and symbolized by sh The Korn shell and symbolized by ksh The Bourne againshell and symbolized by the bash The second type includes: C shell TENEX / TOPS C shell TCSH The beginning of the shell was with the Bourne shell where stephen R.Bourne wrote it on the unix system in the mid 1970's at the AT&T lab. Therefore, some call it the shell, "The Shell," because it first appeared. This shell is usually located in the path / bin / sh As mentioned earlier, the shell is a command interpreter and also contains a programming language using syntax formula ALGOL language, and contains the following things: Variables, functions, program control commands, repeating commands, processing commands, mathematical expressions, etc. All the Bourne-type types share these features, but the disadvantage of this original type is the difficulty in using it. There is no auto-complete feature, and there is no save command that has been executed. Ten years later, in 1980, Bill Joy wrote the C shell, avoiding the difficulty found in the previous type and also making the syntax formula from ALGOL to C language.
Some of the features found in it: The property of completing the text, save previously written commands. Usually we find this shell inside the / bin / csh path Its disadvantages are: Weakness in supporting I / O operations lacks functions, so it is not recommended for programming, only for use. The TENEX / TOPS C shell, symbolized by tcsh, is an improved version of the cshell where additions of many features, including the use of the arrows (up - down) to view the commands that have been executed as well as the arrow (right - left) to modify these commands. At this time, after two types of shell were available, David Korn in AT&T wrote the Korn shell and symbolized by ksh It combines the ease of the C shell, as well as the Bourne shell, making ksh the preferred choice for many users. In general, the ksh is compatible with the first type, which is the sh. There are 3 copies of this paralysis: The official symbolized by ksh which we talked about and the public domain and symbolized by pdksh and finally the version of Desktop and symbolized by dtksh.
Shell programmers often use the first and second versions. The third dtksh is for Shell users. The ksh is usually found in the / bin / ksh or / usr / bin / ksh paths.Other versions can be downloaded from the net if it does not come with your system. Finally, the Bourne again shell, which is currently used in most distributions where the developer Brian fox collected the previous features and put it in it so it is now preferred and is usually found in the path / bin / bash or path / bin / sh where it became the default shell.
When does paralysis begin and end?
When you log on to the system, getty starts to work where you are asked to type your username and passwords and then passes it to the login program that checks the entered data, by comparing it with / etc / passwd and it looks like this: SudaNix: x: 500: 500: ahmad: / home / SudaNix: / bin / bash In the case of matching, the paralysis in the file will be executed, in this case is / bin / bash and when you exit logging Shell ends work and to change the type of paralysis change it by typing the command: / bin / csh Here changed to Cshell and exit Interactive and non-interactive paralysis !! When you see the prompt prompt, this means that immobilization works interactively interactive, I mean interactively, that is, you are expected to write commands to execute This is the usual normal situation where you enter the system, then the immobilization begins to work .. Then you write some commands, and exit the system Shell is suspended.
It is contradicted by non-interactive paralysis: It means that there is no interaction between you and Shell, that is, you will not be waiting for you to write any commands, where he executes commands saved inside a file and when it reaches the end of the file stops working and this is known as the script. Two basic concepts are:
Commands
It is a program that you can run by typing its name and then press enter. Example: The date command shows the day, the date, the hour. Note that the $ prompt is reappeared and this indicates that the program has finished executing. Another example is the command, which shows the names of all users of this system in addition to some information and there are several types of commands, namely, simple commands, complex, complex.
Complex commands
A simple program name plus one or more arguments.
Complex commands
A simple program name plus one or more arguments.
An example to make it clear: As mentioned, we give you information about all users and their access times to the system, but by typing it: The username you are working on and the time you access the system. So am and i are intermediaries who interfere with who adjusts his behavior. Most of the existing commands accept many arguments that change their default behavior and we will see that later.
Compound commands
They are commands that combine simple and complex commands. They are separated by semicolon; Example command: date; who am i; This complex command executes the simple command date first and then executes the complex command whoam i and commands are separated using a semicolon and if not placed, ie the command is written as: date who am i will happen an error .. etc). etc).
He can build chairs, tables, cabinets, etc. Using the same tools, but with a certain composition, he can build anything he wants. This example is very similar to shell scripting. To build anything you want, you must use the right tools and call them commands or programs, which are mentioned above. Write the first shell script: Open any document - Text file - and type the following: date; who; Save the file by any name and let it be sudanix Now you run this script, type: / bin / bash sudanix Now the result will appear which is the output of the date command and the output of the command who. To convert a script into a scriptable executable ?? One of the most important steps, in order to make the file executable ..
Any we execute by name only. she: Convert the file into an executable file by command chmod a + x ./sudanix But we have to make sure which shell will be used. Because we don't guarantee that all shell users are working on bash, we will add this line to the start of the script. #! / bin / bash Note that this line at the beginning of the script. Specifically in the first line !! Otherwise, the script will be as follows: #! / bin / bash date; who; Now to execute this script write it on the following form with a note to be in the same folder that contains the script. ./sudanix The bash shell is the default shell of the GNU system The GNU project, referring to GNU's Not UNIX, provides tools for the management of Unix-like systems, free operating systems that comply with Unix standards.