Quiz 7
What is the output of this code segment? Unix=('Debian' 'Red hat' 'CentOS' 'Suse' 'Fedora') echo ${ Unix[@]:2:2 }
CentOS Suse
What is the output of this code segment? Unix=('Debian' 'Red hat' 'Ubuntu' 'Suse' 'Fedora' 'UTS' 'OpenLinux') pos=3 Unix=(${Unix[@]:0:$pos} ${Unix[@]:pos + 1))}) echo ${Unix[@]}
Debian Red hat Ubuntu Fedora UTS OpenLinux
What is the output of this code segment? Unix=('Debian' 'Red hat' 'Ubuntu' 'Suse' 'Fedora' 'UTS' 'OpenLinux') Linux=("${Unix[@]}") echo ${Linux[@]}
Debian Red hat Ubuntu Suse Fedora UTS OpenLinux
Give this datafile that contains: USA Canada Britain China What will this code segment display? #!/bin/bash country=( `cat datafile` ) for t in "${ country[@] } " do echo $t done
USA Canada Britain China
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
san_1 san_2 san_3
What is the output of this code segment? Unix=('Debian' 'Red hat' 'CentOS' 'Suse' 'Fedora') echo ${ #Unix[@] }
5
What is the output of this code segment? Unix=('Debian' 'Red hat' 'Ubuntu' 'Suse' 'Fedora' 'UTS' 'OpenLinux') Unix=("${Unix[@]}" "AIX" "HP-UX") echo ${Unix[7]}
AIX
What is the output this code segment? Unix=('Debian' 'Red hat' 'Ubuntu' 'Suse' 'Fedora' 'UTS' 'OpenLinux') unset Unix echo ${ Unix[@] }
Nothing
What is the output of this code segment? Unix=('Debian' 'Red hat' 'CentOS' 'Suse' 'Fedora'); Unix= echo ${ Unix[@] }
Red hat CentOS Suse Fedora
What is the output of this code segment? Unix=('Debian' 'Red hat' 'CentOS' 'Suse' 'Fedora') echo ${Unix[3]}
Suse