Site icon 咖啡偶-IT日常

Linux shell script 關於array陣列用法

定義一個陣列

declare -a source_dirs_weekly=("2-w3-portal" "2-w3-opt" "2-w3-jtrac" "200-printer" "194-easyflow" "229-fileserver")

也可以醬

declare -a source_dirs_weekly=(
"2-w3-portal" 
"2-w3-opt" 
"2-w3-jtrac" 
"200-printer" 
"194-easyflow" 
"229-fileserver"
)

要取出資料,可以參考以下的設定, 來源為這 https://opensource.com/article/18/5/you-dont-know-bash-intro-bash-arrays

Exit mobile version