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: Murtazad) 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
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
Top Linux OS Shell Questions
☺ | cmd > abc 2>&1 will: |
☺ | The redirection 2> abc implies: |
☺ | Which of these is the correct method for appending \"foo\" in /tmp/bar file? |
☺ | Which one of the following is not a valid shell variable? |
☺ | What will be output of following command: |
Top Linux OS Categories
☺ | Device Drivers Interview Questions. |
☺ | Linux OS Management Interview Questions. |
☺ | Linux Makefile Interview Questions. |
☺ | Linux Environment Interview Questions. |
☺ | Linux OS Shell Interview Questions. |