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
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
C is correct
vagrant@ubuntu-xenial:~$ for token in a b c; do
> echo -n “$token “;
> done
“a ““b ““c “
vagrant@ubuntu-xenial:~$
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:~$