Fill the terminal screen with dots
Clash 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
Why didn't only the first column get fully filled?
What's wrong?
bash terminal
add a comment |Â
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
Why didn't only the first column get fully filled?
What's wrong?
bash terminal
add a comment |Â
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
Why didn't only the first column get fully filled?
What's wrong?
bash terminal
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
Why didn't only the first column get fully filled?
What's wrong?
bash terminal
asked May 2 at 12:04
smarber
3011213
3011213
add a comment |Â
add a comment |Â
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.
Well I do need another coffee :D, thank you
â smarber
May 2 at 12:19
add a comment |Â
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.
Well I do need another coffee :D, thank you
â smarber
May 2 at 12:19
add a comment |Â
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.
Well I do need another coffee :D, thank you
â smarber
May 2 at 12:19
add a comment |Â
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.
Because printing the dot moves the cursor one position right, too. "Moving forward" means from the current position, not from the line beginning.
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
add a comment |Â
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password