RE: How to access array value in Shell Programming?

How to access array value in Shell Programming?

chayan Senior Developer Asked on March 7, 2018 in LINUX.
Add Comment
1 Answers

 

#!/bin/sh
socialmedia[0]="facebook"

socialmedia[1]="twitter"
echo "First Index: ${socialmedia[0]}"

echo "Second Index: ${socialmedia[1]}"

 

Output:

First Index: facebook
Second Index: twitter

Team Leader Answered on December 27, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.