0

I just want to echo spaces until it fills the size of the terminal. I can just write spaces between the quotation marks but it takes time and also it looks bad.

I tried simple things like

a=" "*100 or a=(" "*100) & echo $a

but it won't work. Is there any way like Space(100) or a better way than typing spaces.

Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223

1 Answers1

0

Like this, using Perl:

perl -sE 'say " " x $col' -- -col=$COLUMNS

Or the most simple:

printf '%*s' $COLUMNS " "

The variable $COLUMNS is the number of columns in your shell.

Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223