Problems with the Question “Submit the echo statement that would print “www2.inlanefreight.com” when running the last “Arrays.sh” script.”
I thought i have to change the FSI variable but it does not work
Thx
Problems with the Question “Submit the echo statement that would print “www2.inlanefreight.com” when running the last “Arrays.sh” script.”
I thought i have to change the FSI variable but it does not work
Thx
you don’t really need to run any code for this though, look at the code example before the question and you’ll find the answer by looking at the index for “www2.inlanefreight.com”
thx a lot… I thought too difficult
First off, I am a new user, so I cant post more than two websites in a post. If it says .con, replace that with “dot com”.
I submitted a ticket for this question. Tell me if I am just not interpreting the content correctly but…
The question asks us to:
“Submit the echo statement that would print “www2.inlanefreight.con” when running the last “Arrays.sh” script.”
Arrays.sh:
#!/bin/bash
domains=(www.inlanefreight.con ftp.inlanefreight.con vpn.inlanefreight.con www2.inlanefreight.con)
echo ${domains[0]}
What SHOULD be the correct response would be:
echo ${domains[3]}
which returns
www2.inlanefreight.con
which makes sense as domains=(“www.inlanefreight.con ftp.inlanefreight.con vpn.inlanefreight.con” www2.inlanefreight.con)
Counting from 0, 1, 2, 3, we see that www2.inlanefreight.com has a value of 3.
The module declares this the incorrect answer though.
I started guessing, and the accepted response was
echo ${domains[1]}
which returns the text
“ftp.inlanefreight.con”
which just doesn’t seem right to me.
It should be correct. I was dazzled by this as well, It should be 1 as the 3 domains are in quotation marks which the example output confirms echo ${domains[0]} will print all first three domains which act as single string. so there are only three entries in domains array