I want to align a text, for example let's say I want to have 12 spaces to the right before the text. I tried this but I get left aligned and not right aligned:
printf "%12s" "texto" #-->
# texto
How can I get something like this?:
# texto
Fill with spaces as many columns as the terminal has minus 12:
Using two evaluations: one to get the number of columns and one for subtraction.
You can also create a function that echoes the call to printf .
I don't think it's the best solution, but at least it's another one: