Can I remove a newline if I redirect output like this?
echo "a" >> file
I have something similar in my script which contains a for loop that redirects every character (except numbers) to a file. But my goal is to have this output in one line. Let's say I redirect the "a" ten times so it should look like this:
a a a a a a a a a a
but it looks like this:
a
a
a
a
[etc.]
echo -n
orprintf
. – DisplayName Jan 02 '19 at 19:35man echo
- your shell may have a builtinecho
command that behaves differently. See for example Why is printf better than echo? – steeldriver Jan 02 '19 at 19:47