
Code:Array

Output:

Note
you can define array one by one orelse all are one step
to print array value ${arr[0]},${arr[1]},...
to print all elements of array use "@" or "*"
ex: ${arr[@]}
: ${arr[*]}
Code:Shell Variables

Output:

Note
why ";" used 4th line before "cal"
with out ";" "cal" take as a string so print "cal"
with ";" only "cal" take as shell variable so print the calender
also you can do it without ";" by adding cal to the next line

No comments:
Post a Comment