Raspberry Pi_Eng_20.2.2 How Shell Runs Commands

20.2.2 How Shell Runs Commands

20.2.2.1 Types of Kernel’s System Calls

● “fork” system call

This call is one of the system call methods that a process uses to execute another process. When a command needs to be executed, a child process is created and executed separately.

Raspberry Pi_Eng_20.2.1 Shell and script

20.2 Batch Run of Commands via Script

Here we will look at the script tool we use to process multiple commands in batch at once. We will discuss the concept of script, how to write a script, how to execute a script, and so on.

20.2.1 Shell and script

20.2.1.1 What is Script?

On Linux systems, Shell plays a central role in executing commands. Among the various Shell programs, BASH is specified as the default shell. BASH receives a command entered by the user in the terminal environment, interprets the meaning of the command, processes the command according to the specified method, and returns the processing result to the user.

Raspberry Pi_Eng_20.1.2 Manual Run and Automatic Run

20.1.2 Manual Run and Automatic Run

Based on the subject who instructs the processing, the processing method can be divided into the manual execution and utomatic execution can

● Manual execution

In this method, the user instructs to process certain commands. The user determines the required point of time for execution, and the user also determines the contents of the specific command to be entered for execution and instructs the command. The command to be executed here may be an individual command or a bundle of commands defined by a script. Whatever it is, the user will decide the start of the run.

Raspberry Pi_Eng_20.1.1 Individual Run and Batch Run

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.

Raspberry Pi_Eng_20.0 Chapter 20 Batch Run and Automatic Run

Chapter 20 Batch Run and Automatic Run

Chapter’s Main Topics

This chapter describes the several ways to execute commands on a Linux system. You can execute commands one by one, or you can execute several commands at once. You can also run it manually or let the system run automatically.

In this regard, we will look at the Script tools we use to process multiple commands at once. We will also look at tools that can execute commands at regular intervals.

It includes descriptions on the following topics:
■ Individual execution and batch execution

■ Manual execution and automatic execution

■ Batch execution with script

■ Automatic execution with init script

■ Automatic execution by schedule

Raspberry Pi_Eng_17.8 Upgrade of System Kernel and Firmware

17.8 Upgrade of System Kernel and Firmware

The kernel and firmware of the Raspberry Pi system are continuously being upgraded to fix errors, improve system performance, and provide additional functionality. If a certain period of time has elapsed since the installation of the Raspberry Pi system, the currently installed system may be different from the system of the latest version. Also, if a specific application is developed based on the latest version of the system, it may cause an error if the program is used on the system of the previous version. Therefore, it is sometimes necessary to upgrade the kernel and firmware.

Raspberry Pi_Eng_17.7.3 “apt-get upgrade” Command- Reflect Updated Program

17.7.3 “apt-get upgrade” Command- Reflect Updated Program

If a program already installed on the system is modified afterward, it is necessary to replace it with a new program. This is done using “upgrade” command in “apt-get” command.

Raspberry Pi_Eng_17.7.2 “apt-get update” command – Update Local Package DB

17.7.2 “apt-get update” command – Update Local Package DB

The “update” command is used to update the program package information in the local package repositoroty installed on the system to the latest version. When this command is executed, the package information stored in the local package repository is updated to the latest version, and the latest package file for the installed program is downloaded and archived.

Raspberry Pi_Eng_17.7.1 Upgarde of Program

17.7 Update and Upgrade of Program

17.7.1 Upgarde of Program

The package managed by the package repository manages software distribution and metadata in the form of archive files. When a package is installed on a specific computer, the metadata contained in the package is stored in the local package database. In this local package database, typical information such as software dependency and version is managed. The package manager uses this local package database to prevent discrepancies between software and missing essential items.

Raspberry Pi_Eng_17.6.2 Cleaning Program Package File

17.6.2 Cleaning Program Package File

During the process of installing or upgrading programs, the related program package file is downloaded and stored in the local repository “/var/cache/apt/archives/”. These files are not deleted and remain intact even if the program installation is completed or the program is removed. If these files continue to accumulate, it will take up unnecessary storage space in the system, so it’s a good idea to remove any files that is no longer needed.