Showing posts with label Array in Korn Shell. Show all posts
Showing posts with label Array in Korn Shell. Show all posts

Saturday, May 23, 2020

Array Example in Korn Shell

#!/bin/ksh -x
arr[0]="Hello"
arr[1]="World"
print "${arr[0]} ${arr[1]}"
#to print the array using index
index=1
print -n '${arr[index]}='
print  "${arr[index]}"
#to print the whole array
print "The whole array is ${arr[*]}"