0

I have a numeric value stored in a bash variable n and want to use the number to introduce n newlines when using printf after the arguments. How can I do this?

n=0
printf '%s\n' "$@"
printf '%s\n\n' ""

n=1
printf '%s\n' "$@"
printf '%s\n' ""

n=3
printf '%s\n' "$@"
printf '%s\n\n\n' ""
Dilna
  • 405
  • 1
  • 6

0 Answers0