목록Shell script (26)
S_pot

#!/bin/bash array=(5 3 7 2 9) for item in ${array[@]} do echo $item done 타입에 구애받지 않고 출력됨 #!/bin/bash array=(5 "apple" 7 3.14 9) for item in ${array[@]} do echo $item done 아래로 정렬이 아닌 옆으로 값을 정렬하고 싶으면 echo를 사용 #!/bin/bash array=(5 "apple" 7 3.14 9) echo ${array[@]}

1 1 #!/bin/sh 2 for VAL in 0 1 2 3 do 4 echo "VAL = ${VAL}" 5 done 2 #!/bin/bash for ((i=0; i < 10; i++)) do echo $i done

#!/bin/sh PATH_VAL="/home/bnk/code/home/bnk/code/bnk/code" echo ${PATH_VAL} echo ${PATH_VAL%/bnk*} echo ${PATH_VAL#/*bnk} echo ${PATH_VAL%%/bnk*} echo ${PATH_VAL##/*bnk}

#!/bin/bash NUM1=1 NUM2=10 if [ $NUM1 -ne $NUM2 ]; then echo "$NUM1과 $NUM2은 같지 않습니다." else echo "$NUM1과 $NUM2은 같습니다." fi

set hlsearch set nu set autoindent set scrolloff=2 set wildmode=longest,list set ts=4 set sts=4 set sw=1 set autowrite set autoread set cindent set bs=eol,start,indent set history=256 set laststatus=2 "set paste set shiftwidth=4 set showmatch set smartcase set smarttab set smartindent set softtabstop=4 set tabstop=4 set ruler set incsearch set statusline=\ %