PS: In the Linux system-based STM8 firmware upgrade project, you need to let the CPU through the I²C bus to STM8 transfer data, just start one of the knock, a waste of time, and then consider the shell script, although the shell script is very simple, but the role is not small, Greatly improves the data transmission efficiency.
1. Use of VI Editor
The VI editor has two modes, command mode and input mode. Input command: Vim test.sh, enter, you can enter the command mode, this time can not be edited, you need to input I enter the input mode. After you have entered, press Wq to exit and press Q to exit without saving. (Vim is the enhanced version of VI)
2, to file permissions
Method 1:chmod +x./test.sh indicates that the test.sh file is executable, and if X is changed to R to indicate that the file is readable, the file can be written if x is changed to W.
Method 2:chmod 777./TEST.SH indicates that the owner, the group that belongs to the host, and other users have read, write, and execute permissions.
Permissions are represented by numbers. The encoding rules are as follows: Readable (R) is 4, writable (W) is 2, executable (x) is 1, no permission (-) is 0.
The attributes listed with LS-L will get the genetic characters:-rwxr-xr-x, a total of 10 characters, the first represents the file attributes (d for folders,-for ordinary files), and the remaining 9 are divided into three groups. Three of each group represents R readable W writable x executable. If it is a letter that has this permission, if yes-indicates that the permission is not available. The first group represents the permissions of the file owner, the second group represents the permissions of the group user who is the owner, and the third group represents the permissions of the other users.
1. Initial knowledge of the Shell scripting language