I have a command which outputs in this format:
A
B
C
D
E
F
G
I
J
etc
I want the output to be in this format
A B C D E F G I J
I tried using ./script | tr "\n" " " but all it does is remove n from the output
How do I get all the output in one line.
Edit: I accidentally put in grep while asking the question. I removed
it. My original question still stands.
The
grepis superfluous.This should work:
It did for me with a command
althat lists its arguments one per line: