"Bash 배열"의 두 판 사이의 차이

(새 문서: ==개요== ;bash 배열 <syntaxhighlight lang='bash' run> ARR=("John Smith" "Jane Doe" "Mike Barnes") echo ${ARR[0]} # John Smith echo ${ARR[1]} # Jane Doe </syntaxhighlight> <syntax...)
 
32번째 줄: 32번째 줄:


==같이 보기==
==같이 보기==
* [[Bash foreach 스타일]]
* [[함수 array()]]
* [[함수 array()]]


[[분류:Bash]]
[[분류:Bash]]
[[분류: 배열]]
[[분류: 배열]]

2020년 11월 27일 (금) 11:44 판

1 개요

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

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}