Shell 13 Question (2) The relationship between shell PROMPT (PS1) and Carriage Return (CR)?

xiaoxiao2021-03-06  88

When you successfully log in to a text interface, under most cases, you will see a flicker or bottom line (depending on the different versions) on the screen, we call the * cursor * (coursor). The role of the cursor is to tell you the next position you are inserted from the button input from the keyboard, and each time you move such as a cacope, you can automatically enter the next row. If you have just completed the login, before you haven't entered any button, you can see the left side of the same line of the position, we call it * prompt symbol * (Prompt). Prompt symbols or different system versions, on Linux, just pay attention to a visible prompt symbols closest to the cursor, usually one of the following: $: Give the general user account #: give Root (administrator) account is in fact, shell prompt means simple: * Yes shell tells the user: You can now enter the command line. We can say that users only get the command line in getting shell prompt, and the cursor is the location indicating the keyboard entered by the keyboard. The user enters a button, and the Cursor moves behind it until it comes to the command. Enter the CR (Carriage Return, generated by the ENTER). The meaning of CR is also very simple: * is the user tells shell: The old brother can perform my command line. Strictly speaking: * The so-called command line is the text entered between Shell Prompt and Cr characters. (Thinking: Why do we insist on using Cr characters and don't say an Enter? The answer is revealed in the later learning.) Different command acceptable command line formats or different, in general, a standard command line format is As listed below: Command-name Options Argument If you come from technical details, the shell will disassemble the text entered by the Command Line according to the IFS (IFS (IFS (IFELD SEPERATOR). Then, for special characters (META), it will be processed, and finally recombine Command Line. (Note: Be sure to understand the meaning of the two sentences, we will often return here in the future.) The IFS is the segment symbol of the shell preset, which can be composed of one and more press: * Blank key (White Space) * Tab * * Enter system acceptable command name (Command-name) can be obtained from the following way: * Clear path to the external command * Command alias (Alias * Function * shell built-in command (Built-in) * $ PATH External Commands Each command line must include a command name, which is not missing.

转载请注明原文地址:https://www.9cbs.com/read-106279.html

New Post(0)