Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Create array

#!/bin/bash

declare -a week=(Mon Tue Wed Thu Fri Sat Sun)
echo $week
echo '-----'

for day in ${week[*]}
do
   echo $day
done
$ ./examples/script/array_creation.sh 
Mon
-----
Mon
Tue
Wed
Thu
Fri
Sat
Sun