Is there a way to use printf to trim the trailing spaces. If I have an expression like:
printf '<%-10s>', "Hello";
It prints "Hello " with 5 trailing spaces.
I would like to print something like this:
"Hello"
without the trailing spaces. I tried using a trim function I found by googling trim spaces perl with no luck. Is there another way of doing this.
printf '<%-10s>', "Hello";
It prints "Hello " with 5 trailing spaces.
I would like to print something like this:
"Hello"
without the trailing spaces. I tried using a trim function I found by googling trim spaces perl with no luck. Is there another way of doing this.