Shell Introduction
During the development process, the Linux system is frequently contacted and used, and the shell is a bridge for our users to use Linux, and is a program written in the C language. The shell is a command language, as well as a programming language. For most developers, mastering the basic use of the shell is a required course.
Run the first shell program
1. New Shell Execution file
[Email protected] test]# VI testshell.sh
2. Enter the following in the file:
#!/bin/bash #约定
echo "Hello world!" #输出语句
3. Save file exit, modify Execute permission
[Email protected] test]# chmod +x./testshell.sh #允许脚本执行权限
[email protected] test]#/testshell.sh #执行脚本
Hello Word!
Note: It is written ./test.sh, not Testshell. SH , because the current directory is not the system path path, only/bin,/sbin,/usr/bin,/usr/sbin, etc. in path.
4, another mode of operation, run the Interpreter
/bin/sh testshell. SH
Hello Word!
Shell Entry Notes (i)