3 added 192 characters in body
source | link

Bash, 14

printf %$#d $@
printf %$#d $@

Input list given at the command line.

Not much to explain here. Simply uses built-in printf facilities to do the necessary padding, based off the number of passed args.:

  • $# is the number of args passed
  • %<n>d is a printf format specifier that prints an integer with up to n leading spaces
  • $@ is the list of all args passed
  • The format specifier is reused for each member of $@.

Ideone.

Bash, 14

printf %$#d $@

Input list given at the command line.

Not much to explain here. Simply uses built-in printf facilities to do the necessary padding, based off the number of passed args.

Ideone.

Bash, 14

printf %$#d $@

Input list given at the command line.

Not much to explain here. Simply uses built-in printf facilities to do the necessary padding, based off the number of passed args:

  • $# is the number of args passed
  • %<n>d is a printf format specifier that prints an integer with up to n leading spaces
  • $@ is the list of all args passed
  • The format specifier is reused for each member of $@.

Ideone.

2 added 241 characters in body
source | link

Bash, 14

printf %$#d $@

Input list given at the command line.

Not much to explain here. Simply uses built-in printf facilities to do the necessary padding, based off the number of passed args.

Ideone.

Bash, 14

printf %$#d $@

Ideone.

Bash, 14

printf %$#d $@

Input list given at the command line.

Not much to explain here. Simply uses built-in printf facilities to do the necessary padding, based off the number of passed args.

Ideone.

1
source | link

Bash, 14

printf %$#d $@

Ideone.