Published Book on Amazon
|All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 1|
|All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 2|
출판된 한글판 도서
|최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (상)|
|최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (하)|
Original Book Contents
20.1 How to Run Command
There are several ways to execute commands in the Raspberry Pi system. Users can run them one by one, or the computer can handle them automatically. We will take a look at what methods can be used here.
20.1.1 Individual Run and Batch Run
Based on the number of command processed at one time, the processing method can be divided into individual execution and batch execution.
● Individual execution methods
This means the way a user handles commands one by one. When executing multiple commands, this means the method to execute commands one by one sequentially from the beginning in the way to execute the first command, see the result, execute the next command again, and check the result.
This method is advantageous in that an exact processing is possible as a user can execute the commands one by one and check the results of the processing. However, when the user has to process a large number of commands repeatedly, the user has to perform the same operation every time, and it will be very inconvenient to the user.
● Batch execution with script
This means that the user executes a batch of commands with a single instruction. The user does not issue an instruction for each command but instructs the execution of the entire command bundle only once. Then several commands in the bundle are processed at once.
At this time, a tool called script is used to group several commands into one bundle. Since multiple commands are processed at once without user intervention, the user should understand the details of the command to be processed and the relationship between the commands before and after it, and the script should be defined well so that unexpected problems do not occur during processing.
This method is very convenient because it is possible to collectively process all the commands in a single instruction when it is necessary to process multiple commands in a certain unit repeatedly.