1.shell Introduction
The shell is a special-function program that provides an interface for users to interact with the kernel. It is used to receive commands entered by the user and send it to the kernel for execution.
The shell is an application that is called into memory when a user logs on to a Linux system. The shell is independent of the kernel, which is a bridge between the kernel and the application, and the input device reads the command and then turns it into a machine code that the computer can understand, before the Linux kernel can execute the command.
2. A simple shell script
whologged.sh
#!/bin/bashdate who
Script Description:
line 1th is "#!/bin/bash", "#!" Symbols are called "Sha-bang" symbols (Sha-bang are combinations of sharp and bang. Sharp for #, Bang for! In a similar scenario, C # is often referred to as CSharp, whichis the starting symbol for the shell script, "#!" A symbol is a special token that specifies a file type, which tells the Linux system that the execution of this file requires an interpreter to be specified.
Program execution:
1. Add executable permissions for whologged.sh.
chmod a+x wologged.sh #a +x is for everyone to add executable permissions, including the owner, the owning group, and others
2. Input./wologged.sh
Operation Result:
Chapter 1th Overview of Shell programming