4
rated 0 times
[
4]
[
0]
/ answers: 1 / hits: 735
/ 2 Years ago, sat, september 11, 2021, 8:01:18
In my file 'foo' there is a first line: 'a b', and the second line: 'c d':
$ cat foo
a b
c d
I want to print in terminal in loop these two lines: one after another:
$ for i in $(cat foo); do echo $i; done
But in the output 'echo' command breaks the order, so instead of having:
a b
c d
I actually have:
a
b
c
d
More From » command-line