010-160日本語 無料問題集「Lpi Linux Essentials Certificate Exam, version 1.6 (010-160日本語版)」
空白を埋める
シェルスクリプトでループを開始するために使用されるキーワードは何ですか? (キーワードを 1 つだけ指定し、追加情報は指定しません。)
シェルスクリプトでループを開始するために使用されるキーワードは何ですか? (キーワードを 1 つだけ指定し、追加情報は指定しません。)
正解:
for Explanation The keyword for is used in a shell script to begin a loop that iterates over a list of items or a range of numbers.
The syntax of the for loop is as follows:
for <var> in <list> do <commands> done
The variable <var> is assigned to each element of the <list> in turn, and the <commands> are executed for each iteration. The <list> can be a sequence of words, numbers, filenames, or other values. If the <list> is omitted, the for loop will iterate over the positional parameters ($1, $2, ...). The do and done keywords mark the beginning and the end of the loop body, respectively. The for loop is one of the three types of loops in shell scripting, along with the while and until loops. References: 1: Looping Statements |Shell Script - GeeksforGeeks 1 2: unix - Shell script "for" loop syntax - Stack Overflow 2 3: For Loop Shell Scripting - javatpoint 3
The syntax of the for loop is as follows:
for <var> in <list> do <commands> done
The variable <var> is assigned to each element of the <list> in turn, and the <commands> are executed for each iteration. The <list> can be a sequence of words, numbers, filenames, or other values. If the <list> is omitted, the for loop will iterate over the positional parameters ($1, $2, ...). The do and done keywords mark the beginning and the end of the loop body, respectively. The for loop is one of the three types of loops in shell scripting, along with the while and until loops. References: 1: Looping Statements |Shell Script - GeeksforGeeks 1 2: unix - Shell script "for" loop syntax - Stack Overflow 2 3: For Loop Shell Scripting - javatpoint 3