Fill the terminal screen with dots

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'd like to create a function draw which fills the terminal with dots.



According to http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html:




Move the cursor forward N columns: 33[< N>C




In the first place, I did this to fill the first column:



draw_col() 
local cols=$(tput cols)

local x=0

while [[ $x -lt $cols ]]
do
echo -en "33[$xC."
x=$(( x+1 ))
done




draw_cols.png



Why didn't only the first column get fully filled?



What's wrong?







share|improve this question























    up vote
    0
    down vote

    favorite












    I'd like to create a function draw which fills the terminal with dots.



    According to http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html:




    Move the cursor forward N columns: 33[< N>C




    In the first place, I did this to fill the first column:



    draw_col() 
    local cols=$(tput cols)

    local x=0

    while [[ $x -lt $cols ]]
    do
    echo -en "33[$xC."
    x=$(( x+1 ))
    done




    draw_cols.png



    Why didn't only the first column get fully filled?



    What's wrong?







    share|improve this question





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'd like to create a function draw which fills the terminal with dots.



      According to http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html:




      Move the cursor forward N columns: 33[< N>C




      In the first place, I did this to fill the first column:



      draw_col() 
      local cols=$(tput cols)

      local x=0

      while [[ $x -lt $cols ]]
      do
      echo -en "33[$xC."
      x=$(( x+1 ))
      done




      draw_cols.png



      Why didn't only the first column get fully filled?



      What's wrong?







      share|improve this question











      I'd like to create a function draw which fills the terminal with dots.



      According to http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html:




      Move the cursor forward N columns: 33[< N>C




      In the first place, I did this to fill the first column:



      draw_col() 
      local cols=$(tput cols)

      local x=0

      while [[ $x -lt $cols ]]
      do
      echo -en "33[$xC."
      x=$(( x+1 ))
      done




      draw_cols.png



      Why didn't only the first column get fully filled?



      What's wrong?









      share|improve this question










      share|improve this question




      share|improve this question









      asked May 2 at 12:04









      smarber

      3011213




      3011213




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          Because printing the dot moves the cursor one position right, too. "Moving forward" means from the current position, not from the line beginning.






          share|improve this answer





















          • Well I do need another coffee :D, thank you
            – smarber
            May 2 at 12:19










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f441304%2ffill-the-terminal-screen-with-dots%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote



          accepted










          Because printing the dot moves the cursor one position right, too. "Moving forward" means from the current position, not from the line beginning.






          share|improve this answer





















          • Well I do need another coffee :D, thank you
            – smarber
            May 2 at 12:19














          up vote
          3
          down vote



          accepted










          Because printing the dot moves the cursor one position right, too. "Moving forward" means from the current position, not from the line beginning.






          share|improve this answer





















          • Well I do need another coffee :D, thank you
            – smarber
            May 2 at 12:19












          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          Because printing the dot moves the cursor one position right, too. "Moving forward" means from the current position, not from the line beginning.






          share|improve this answer













          Because printing the dot moves the cursor one position right, too. "Moving forward" means from the current position, not from the line beginning.







          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered May 2 at 12:10









          choroba

          24.3k33967




          24.3k33967











          • Well I do need another coffee :D, thank you
            – smarber
            May 2 at 12:19
















          • Well I do need another coffee :D, thank you
            – smarber
            May 2 at 12:19















          Well I do need another coffee :D, thank you
          – smarber
          May 2 at 12:19




          Well I do need another coffee :D, thank you
          – smarber
          May 2 at 12:19












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f441304%2ffill-the-terminal-screen-with-dots%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay