Using variables in printf format
问题 Suppose I have a file like this: $ cat a hello this is a sentence and this is another one And I want to print the first two columns with some padding in between them. As this padding may change, I can for example use 7 : $ awk '{printf "%7-s%s\n", $1, $2}' a hello this and this Or 17 : $ awk '{printf "%17-s%s\n", $1, $2}' a hello this and this Or 25 , or... you see the point: the number may vary. Then a question popped: is it possible to assign a variable to this N , instead of hardcoding the