Prevent Bash script overflowing printed text when at console edge

Viewed 45

If my console window has width of 30, and I print the following line:

printf "This is exactly forty characters printed!"

It will display as such:

This is exactly forty character
s printed!

Whereas I would like to avoid the drop onto a new line, and rather let the last 10 characters 'be hidden' beyond the terminal edge.

Is this possible with a Bash script?

0 Answers
Related