such as script scripts.sh
1. Create a new shell
Add statement at the beginning of the scripts file: #!/bin/sh, via ./scripts.sh(requires execute permission) or sh scripts.sh(no execute permission required)
2. Do not create a new shell, execute commands under the current shell
Pass. (dot)./scripts.sh or source./scripts.sh execution
Extended function point:
Source and Point commands
The source command is a built-in command of the Bash shell, which comes from C shell.
Another notation for the source command is the point symbol, which is used in the same way as source, from the Bourne shell.
The source command can force a script to immediately affect the current environment.
The source command enforces all commands in the script and ignores the permissions of the file.
The source command is typically used to re-execute a newly modified initialization file, such as. Bash_profile and. Profile, and so on.
The source command can affect the environment of the parent Shell that executes the script, and export can only affect the environment of its child Shell .
Shell two classes of execution methods