BIG
shell script - bash - Loop statement sample code
#!/bin/bash
# A simple 'for' loop
for i in 1 2 3 4 5; do
echo $i
done
# A 'for' loop using the 'seq' command
for i in $(seq 1 5); do
echo $i
done
# A 'while' loop
j=1
while [ $j -le 5 ]; do
echo $j
j=$((j + 1))
done
LIST
'!!...Linux' 카테고리의 다른 글
[Linux] shell script storage usage monitoring email sending (0) | 2023.02.09 |
---|---|
[Linux] shell script simple ssh connection sample code (0) | 2023.02.09 |
[Linux] Centos7 / iptables 설정 (0) | 2023.02.02 |
[Linux] Apache 설정 HTTP_X_FORWARDED_FOR IP 추가 설정 (0) | 2022.10.20 |
[Linux] Centos 7 / scp use sample (0) | 2022.10.18 |