Bash 배열


개요

bash 배열
ARR=("John Smith" "Jane Doe" "Mike Barnes")
echo ${ARR[0]}
# John Smith
echo ${ARR[1]}
# Jane Doe
ARR=(
"John Smith"
"Jane Doe"
"Mike Barnes"
)
ARR=()
ARR+=("John Smith")
ARR+=("Jane Doe")
ARR+=("Mike Barnes")
NAMES[21]="John Smith"
NAMES[99]="Jane Doe"
echo ${NAMES[21]}
# John Smith
echo ${NAMES[99]}
# Jane Doe

같이 보기