Allign the text result of a for/next cicle

Dear community,
probably is quite easy, but I'm scratching my head to find a solution on Red Hat bash. What I have to do is to allign the result of a for/next cicle, something like:

$ printf("%-5s %05x %5d\n", $next, $Server, $Client)
-sh: syntax error near unexpected token `"%-5s %05x %5d\n",'

This because without formatting I got:

ID: 1234 Server: 10 Client: 20
ID: 123 Server: 200 Client: 30
ID: 12345 Server: 1200 Client: 1

And I would like to have something like:

ID: 1234   Server: 10    Client: 20
ID: 123    Server: 200   Client: 30
ID: 12345  Server: 1200  Client: 1

Thanks who can help me! :wink:
Lucas

printf "%-5s %05s %5d\n" $next $Server $Client
1 Like

Damn, the brackets.... I knew it was simple :stuck_out_tongue:
Thanks

and commas

Hi.

The utility align is more general, results for align filename:

ID:  1234 Server:    10 Client: 20
ID:   123 Server:   200 Client: 30
ID: 12345 Server:  1200 Client:  1

Note that by default numbers are right-adjusted, other strings left. See: align for details.

Best wishes ... cheers, drl