Interviewer And Interviewee Guide

Linux OS Shell Interview Question:

What is the output of this program?

#!/bin/bash
var[1]=san_1
var[2]=san_2
var[3]=san_3
echo ${var[*]}
exit 0
a) san_1
b) san_2
c) san_3
d) san_1 san_2 san_3

Submitted by: Murtaza
d) san_1 san_2 san_3
Explanation:
All items of an array can be accessed by using ${[*]} or ${[@]}.
Output:
root@ubuntu:/home/google# ./test.sh
san_1 san_2 san_3
root@ubuntu:/home/google#
Submitted by: Murtaza

Read Online Linux OS Shell Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.