For Ex :
echo "adsa " >> a.txt
echo "asdad " >> a.txt
in my file
adsa
asdad
But i am looking for
adsa asdad
For Ex :
echo "adsa " >> a.txt
echo "asdad " >> a.txt
in my file
adsa
asdad
But i am looking for
adsa asdad
Some platforms support echo -n
to suppress printing newline... man echo
might help
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
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