What is the output of the following command sequence?

What is the output of the following command sequence?
for token in a b c; do
echo -n “$token “;
done

What is the output of the following command sequence?
for token in a b c; do
echo -n “$token “;
done

A.
anbncn

B.
a b c

C.
“a ” “b ” “c “

D.
token token token

E.
abc



Leave a Reply 2

Your email address will not be published. Required fields are marked *


fe

fe

C is correct

vagrant@ubuntu-xenial:~$ for token in a b c; do
> echo -n “$token “;
> done
“a ““b ““c “
vagrant@ubuntu-xenial:~$

fe

fe

ignore, we need to understand the cmd …
E is correct if

vagrant@ubuntu-xenial:~$ for token in a b c; do echo -n “$token”; done
abc
vagrant@ubuntu-xenial:~$

without -n option

vagrant@ubuntu-xenial:~$ for token in a b c;
> do echo “$token”
> done
a
b
c

and
vagrant@ubuntu-xenial:~$ token=”a b c”
vagrant@ubuntu-xenial:~$ echo $token
a b c
vagrant@ubuntu-xenial:~$