#!/bin/bash
for var in 1 2 3 4 5
do
echo case#1 value : ${var}
done
echo -----------------
list="1 2 3 4 5"
for var in ${list}
do
echo case#2 value : ${var}
done
echo -----------------
for var in {1..5}
do
echo case#3 value : ${var}
done
echo -----------------
for var in {1..5..2}
do
echo case#4 value : ${var}
done
echo -----------------
for var in $(seq 5) # for var in $(seq 1 5)
do
echo case#5 value : ${var}
done
echo -----------------
for var in $(seq -s " " 1 2 5)
do
echo case#6 value : ${var}
done
shell script로 checkbox 표현하기 (0) | 2024.06.25 |
---|---|
[shell script] 위치 매개 변수(Positional Parameters) (0) | 2021.10.03 |
[shell script] 배열(Array) (0) | 2021.10.03 |
[shell script] 사용자 입력 받기 (read) (0) | 2021.10.02 |
[shell script] 주석 처리 (0) | 2021.09.29 |