Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 6800  / 1 Year ago, sun, february 19, 2023, 12:07:36

echo "xxx" >> file_a is similar to what I want.



But it always attach string with a new line.



If I just want to attach string without a new line,



How to do it?



Thank you~


More From » scripts

 Answers
1

Use the printf builtin bash function



printf "xxx" >> file


or the -n option to echo, that suppress the newline.


[#43655] Tuesday, February 21, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
scrubuz

Total Points: 194
Total Questions: 96
Total Answers: 127

Location: Monaco
Member since Fri, Sep 24, 2021
3 Years ago
;