Reputation: 10362
For Ex :
echo "adsa " >> a.txt
echo "asdad " >> a.txt
in my file
adsa
asdad
But i am looking for
adsa asdad
Upvotes: 0
Views: 2712
Reputation: 360625
You can also use printf
:
printf "adsa " >> a.txt
printf "asdad " >> a.txt
printf "\n" >> a.txt
or
printf "adsa " >> a.txt
printf "asdad \n" >> a.txt
Upvotes: 5
Reputation: 28767
Specifically, bash
(from OP's tag) has a builtin echo
which supports -n
. Try help echo
from bash
to see the help for the builtin command
Upvotes: 2
Reputation: 6581
Some platforms support echo -n
to suppress printing newline... man echo
might help
Upvotes: 6