How do I create a fake process bar?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
3
down vote
favorite
I want the terminal to show some kind of process bar based on time, like 1% every 60 seconds for example.
command-line
 |Â
show 1 more comment
up vote
3
down vote
favorite
I want the terminal to show some kind of process bar based on time, like 1% every 60 seconds for example.
command-line
See How to add a progress bar to a shell script? - Stack Overflow
â wjandrea
Apr 23 at 18:11
3
Possible duplicate of Create a progress bar in bash
â wjandrea
Apr 23 at 18:12
6
To reviewers: IMO this is neither unclear nor a duplicate to the linked question, it asks precisely for a fake progress bar and is quite clear about the fake data. If you consider this unclear nevertheless, please add a comment explaining how OP can improve the question.
â dessert
Apr 23 at 18:49
1
@dessert Re my dupe flag, I don't see how a fake progress bar is different from a real one. Edit: after reading your answer, I think I get it, but I could still use some clarity.
â wjandrea
Apr 23 at 20:20
1
Most of the progress bar examples I've seen online are fake in the first place so people can copy and paste them :)
â WinEunuuchs2Unix
Apr 23 at 21:44
 |Â
show 1 more comment
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I want the terminal to show some kind of process bar based on time, like 1% every 60 seconds for example.
command-line
I want the terminal to show some kind of process bar based on time, like 1% every 60 seconds for example.
command-line
edited Apr 24 at 6:10
muru
129k19271462
129k19271462
asked Apr 23 at 18:05
![](https://i.stack.imgur.com/a0Xcz.jpg?s=32&g=1)
![](https://i.stack.imgur.com/a0Xcz.jpg?s=32&g=1)
Graham Miranda
234
234
See How to add a progress bar to a shell script? - Stack Overflow
â wjandrea
Apr 23 at 18:11
3
Possible duplicate of Create a progress bar in bash
â wjandrea
Apr 23 at 18:12
6
To reviewers: IMO this is neither unclear nor a duplicate to the linked question, it asks precisely for a fake progress bar and is quite clear about the fake data. If you consider this unclear nevertheless, please add a comment explaining how OP can improve the question.
â dessert
Apr 23 at 18:49
1
@dessert Re my dupe flag, I don't see how a fake progress bar is different from a real one. Edit: after reading your answer, I think I get it, but I could still use some clarity.
â wjandrea
Apr 23 at 20:20
1
Most of the progress bar examples I've seen online are fake in the first place so people can copy and paste them :)
â WinEunuuchs2Unix
Apr 23 at 21:44
 |Â
show 1 more comment
See How to add a progress bar to a shell script? - Stack Overflow
â wjandrea
Apr 23 at 18:11
3
Possible duplicate of Create a progress bar in bash
â wjandrea
Apr 23 at 18:12
6
To reviewers: IMO this is neither unclear nor a duplicate to the linked question, it asks precisely for a fake progress bar and is quite clear about the fake data. If you consider this unclear nevertheless, please add a comment explaining how OP can improve the question.
â dessert
Apr 23 at 18:49
1
@dessert Re my dupe flag, I don't see how a fake progress bar is different from a real one. Edit: after reading your answer, I think I get it, but I could still use some clarity.
â wjandrea
Apr 23 at 20:20
1
Most of the progress bar examples I've seen online are fake in the first place so people can copy and paste them :)
â WinEunuuchs2Unix
Apr 23 at 21:44
See How to add a progress bar to a shell script? - Stack Overflow
â wjandrea
Apr 23 at 18:11
See How to add a progress bar to a shell script? - Stack Overflow
â wjandrea
Apr 23 at 18:11
3
3
Possible duplicate of Create a progress bar in bash
â wjandrea
Apr 23 at 18:12
Possible duplicate of Create a progress bar in bash
â wjandrea
Apr 23 at 18:12
6
6
To reviewers: IMO this is neither unclear nor a duplicate to the linked question, it asks precisely for a fake progress bar and is quite clear about the fake data. If you consider this unclear nevertheless, please add a comment explaining how OP can improve the question.
â dessert
Apr 23 at 18:49
To reviewers: IMO this is neither unclear nor a duplicate to the linked question, it asks precisely for a fake progress bar and is quite clear about the fake data. If you consider this unclear nevertheless, please add a comment explaining how OP can improve the question.
â dessert
Apr 23 at 18:49
1
1
@dessert Re my dupe flag, I don't see how a fake progress bar is different from a real one. Edit: after reading your answer, I think I get it, but I could still use some clarity.
â wjandrea
Apr 23 at 20:20
@dessert Re my dupe flag, I don't see how a fake progress bar is different from a real one. Edit: after reading your answer, I think I get it, but I could still use some clarity.
â wjandrea
Apr 23 at 20:20
1
1
Most of the progress bar examples I've seen online are fake in the first place so people can copy and paste them :)
â WinEunuuchs2Unix
Apr 23 at 21:44
Most of the progress bar examples I've seen online are fake in the first place so people can copy and paste them :)
â WinEunuuchs2Unix
Apr 23 at 21:44
 |Â
show 1 more comment
2 Answers
2
active
oldest
votes
up vote
6
down vote
accepted
Create a progress bar in bash lists approaches to get a progress bar, so I'll concentrate on the How to fake part here. I'll use 2 seconds instead of your 60 here just for testing, adjust the sleep
value to your exact needs.
Using dialog
, whiptail
or zenity
(GUI)
for i in 1..100; do sleep 2; echo $i; done | dialog --gauge 'Running...' 6 60 0
This for
loop loops1 over the numbers one to hundred and echo
s them every 2
seconds, the output is then piped to dialog
, which shows the number as the progress on a progress bar. This approach works for whiptail
and zenity --progress
(GUI) as well. dialog
's output looks like this with a colored progress bar using 'curses' in text mode:
Using pv
for i in 1..100; do sleep 2; echo; done | pv -pWs100 >/dev/null
This loop is very similar, just that it prints only a newline (=1 byte of data) every 2
seconds, pv
is then told to expect exactly 100
bytes of data and show a p
rogress bar. In a terminal window with a width of 80 characters the output looks like this:
[===============> ] 22%
Constructing your own progress bar
With a simple loop you can also construct your own progress bar. Here are some examples that just print 100 #
in one line, one per 2 seconds:
# number signs only
$ for i in 1..100; do sleep 2; echo -n #; done; echo
####################################################################################################
# with progress in % on the right
$ for i in 1..100; do sleep 2; printf "%0.s#" $(seq 1 $i); printf "%0.s " $(seq $i 100); printf "%3d%%r" "$i"; done; echo
###################################################### 54%
# with progress in % on the left
$ for i in 1..100; do sleep 2; printf "%3d%% " "$i"; printf "%0.s#" $(seq 1 $i); printf "%0.s " $(seq $i 100); printf "r"; done; echo
39% #######################################
1 Look, a Polyptoton!
add a comment |Â
up vote
3
down vote
Fake Progress Bar
Here's my fake progress bar:
It uses yad
which is a super-charged version of zenity
the default GUI used in the terminal. To install yad
use:
sudo apt install yad
Here's the code you can copy and paste because everyone has the /usr/bin
directory:
#!/bin/bash
# NAME: yad-progress-bar
# PATH: $HOME/bin
# DESC: Display yad progress bar % with names.
# DATE: Apr 23, 2018.
title="AU question: https://askubuntu.com/q/1027543/307523"
Percent=0
for f in /usr/bin/* ; do # 1000+ files so this is fake loop
echo "#$f" # Display file name in progress bar.
echo $Percent # Percent complete
Percent=$(( $Percent + 1 ))
[[ $Percent -gt 100 ]] && break
sleep .05 # Change to 2 seconds for OP's fake.
done | yad --progress --auto-close
--width=500 --height=300
--title="$title" --enable-log "Current filename"
--log-expanded --log-height=250
--log-on-top --percentage=0
--no-cancel --center
exit 0
The percentage is incremented by 1 in each iteration of the for
loop. It should be calculating percentage on 1,000+ files but stops after 100 files.
Why do you iterate over /usr/bin? Why not just usefor i in 1..100
ori=100; while ((--i))
?
â wjandrea
Apr 24 at 0:30
Two notes: 1) Use the newer command substitution syntax$()
instead of backticks, which are deprecated. 2) It would be cleaner to put theyad
options in an array.
â wjandrea
Apr 24 at 0:34
1
@wjandrea I looped through/usr/bin
to give some text to the progress display. I know backticks are frowned upon these days but it was old code I had laying around which I copied without doing a lot of work. I've removed them. Theyad
options in an array does clean up thedone
line but I think this method illustrates to newcomers what is going on with the pipe toyad
with all the details in one spot.
â WinEunuuchs2Unix
Apr 24 at 0:42
+1 for⦠a nice answer. ;D OP asked for the terminal to show some kind of process bar, which is why I concentrated on non-GUI solutions, but this is not at all detrimental to the usefulness of your approach. Thanks for sharing the knowledge!
â dessert
Apr 24 at 6:50
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
Create a progress bar in bash lists approaches to get a progress bar, so I'll concentrate on the How to fake part here. I'll use 2 seconds instead of your 60 here just for testing, adjust the sleep
value to your exact needs.
Using dialog
, whiptail
or zenity
(GUI)
for i in 1..100; do sleep 2; echo $i; done | dialog --gauge 'Running...' 6 60 0
This for
loop loops1 over the numbers one to hundred and echo
s them every 2
seconds, the output is then piped to dialog
, which shows the number as the progress on a progress bar. This approach works for whiptail
and zenity --progress
(GUI) as well. dialog
's output looks like this with a colored progress bar using 'curses' in text mode:
Using pv
for i in 1..100; do sleep 2; echo; done | pv -pWs100 >/dev/null
This loop is very similar, just that it prints only a newline (=1 byte of data) every 2
seconds, pv
is then told to expect exactly 100
bytes of data and show a p
rogress bar. In a terminal window with a width of 80 characters the output looks like this:
[===============> ] 22%
Constructing your own progress bar
With a simple loop you can also construct your own progress bar. Here are some examples that just print 100 #
in one line, one per 2 seconds:
# number signs only
$ for i in 1..100; do sleep 2; echo -n #; done; echo
####################################################################################################
# with progress in % on the right
$ for i in 1..100; do sleep 2; printf "%0.s#" $(seq 1 $i); printf "%0.s " $(seq $i 100); printf "%3d%%r" "$i"; done; echo
###################################################### 54%
# with progress in % on the left
$ for i in 1..100; do sleep 2; printf "%3d%% " "$i"; printf "%0.s#" $(seq 1 $i); printf "%0.s " $(seq $i 100); printf "r"; done; echo
39% #######################################
1 Look, a Polyptoton!
add a comment |Â
up vote
6
down vote
accepted
Create a progress bar in bash lists approaches to get a progress bar, so I'll concentrate on the How to fake part here. I'll use 2 seconds instead of your 60 here just for testing, adjust the sleep
value to your exact needs.
Using dialog
, whiptail
or zenity
(GUI)
for i in 1..100; do sleep 2; echo $i; done | dialog --gauge 'Running...' 6 60 0
This for
loop loops1 over the numbers one to hundred and echo
s them every 2
seconds, the output is then piped to dialog
, which shows the number as the progress on a progress bar. This approach works for whiptail
and zenity --progress
(GUI) as well. dialog
's output looks like this with a colored progress bar using 'curses' in text mode:
Using pv
for i in 1..100; do sleep 2; echo; done | pv -pWs100 >/dev/null
This loop is very similar, just that it prints only a newline (=1 byte of data) every 2
seconds, pv
is then told to expect exactly 100
bytes of data and show a p
rogress bar. In a terminal window with a width of 80 characters the output looks like this:
[===============> ] 22%
Constructing your own progress bar
With a simple loop you can also construct your own progress bar. Here are some examples that just print 100 #
in one line, one per 2 seconds:
# number signs only
$ for i in 1..100; do sleep 2; echo -n #; done; echo
####################################################################################################
# with progress in % on the right
$ for i in 1..100; do sleep 2; printf "%0.s#" $(seq 1 $i); printf "%0.s " $(seq $i 100); printf "%3d%%r" "$i"; done; echo
###################################################### 54%
# with progress in % on the left
$ for i in 1..100; do sleep 2; printf "%3d%% " "$i"; printf "%0.s#" $(seq 1 $i); printf "%0.s " $(seq $i 100); printf "r"; done; echo
39% #######################################
1 Look, a Polyptoton!
add a comment |Â
up vote
6
down vote
accepted
up vote
6
down vote
accepted
Create a progress bar in bash lists approaches to get a progress bar, so I'll concentrate on the How to fake part here. I'll use 2 seconds instead of your 60 here just for testing, adjust the sleep
value to your exact needs.
Using dialog
, whiptail
or zenity
(GUI)
for i in 1..100; do sleep 2; echo $i; done | dialog --gauge 'Running...' 6 60 0
This for
loop loops1 over the numbers one to hundred and echo
s them every 2
seconds, the output is then piped to dialog
, which shows the number as the progress on a progress bar. This approach works for whiptail
and zenity --progress
(GUI) as well. dialog
's output looks like this with a colored progress bar using 'curses' in text mode:
Using pv
for i in 1..100; do sleep 2; echo; done | pv -pWs100 >/dev/null
This loop is very similar, just that it prints only a newline (=1 byte of data) every 2
seconds, pv
is then told to expect exactly 100
bytes of data and show a p
rogress bar. In a terminal window with a width of 80 characters the output looks like this:
[===============> ] 22%
Constructing your own progress bar
With a simple loop you can also construct your own progress bar. Here are some examples that just print 100 #
in one line, one per 2 seconds:
# number signs only
$ for i in 1..100; do sleep 2; echo -n #; done; echo
####################################################################################################
# with progress in % on the right
$ for i in 1..100; do sleep 2; printf "%0.s#" $(seq 1 $i); printf "%0.s " $(seq $i 100); printf "%3d%%r" "$i"; done; echo
###################################################### 54%
# with progress in % on the left
$ for i in 1..100; do sleep 2; printf "%3d%% " "$i"; printf "%0.s#" $(seq 1 $i); printf "%0.s " $(seq $i 100); printf "r"; done; echo
39% #######################################
1 Look, a Polyptoton!
Create a progress bar in bash lists approaches to get a progress bar, so I'll concentrate on the How to fake part here. I'll use 2 seconds instead of your 60 here just for testing, adjust the sleep
value to your exact needs.
Using dialog
, whiptail
or zenity
(GUI)
for i in 1..100; do sleep 2; echo $i; done | dialog --gauge 'Running...' 6 60 0
This for
loop loops1 over the numbers one to hundred and echo
s them every 2
seconds, the output is then piped to dialog
, which shows the number as the progress on a progress bar. This approach works for whiptail
and zenity --progress
(GUI) as well. dialog
's output looks like this with a colored progress bar using 'curses' in text mode:
Using pv
for i in 1..100; do sleep 2; echo; done | pv -pWs100 >/dev/null
This loop is very similar, just that it prints only a newline (=1 byte of data) every 2
seconds, pv
is then told to expect exactly 100
bytes of data and show a p
rogress bar. In a terminal window with a width of 80 characters the output looks like this:
[===============> ] 22%
Constructing your own progress bar
With a simple loop you can also construct your own progress bar. Here are some examples that just print 100 #
in one line, one per 2 seconds:
# number signs only
$ for i in 1..100; do sleep 2; echo -n #; done; echo
####################################################################################################
# with progress in % on the right
$ for i in 1..100; do sleep 2; printf "%0.s#" $(seq 1 $i); printf "%0.s " $(seq $i 100); printf "%3d%%r" "$i"; done; echo
###################################################### 54%
# with progress in % on the left
$ for i in 1..100; do sleep 2; printf "%3d%% " "$i"; printf "%0.s#" $(seq 1 $i); printf "%0.s " $(seq $i 100); printf "r"; done; echo
39% #######################################
1 Look, a Polyptoton!
edited Apr 24 at 7:49
answered Apr 23 at 18:46
![](https://i.stack.imgur.com/9L8vd.png?s=32&g=1)
![](https://i.stack.imgur.com/9L8vd.png?s=32&g=1)
dessert
19.8k55594
19.8k55594
add a comment |Â
add a comment |Â
up vote
3
down vote
Fake Progress Bar
Here's my fake progress bar:
It uses yad
which is a super-charged version of zenity
the default GUI used in the terminal. To install yad
use:
sudo apt install yad
Here's the code you can copy and paste because everyone has the /usr/bin
directory:
#!/bin/bash
# NAME: yad-progress-bar
# PATH: $HOME/bin
# DESC: Display yad progress bar % with names.
# DATE: Apr 23, 2018.
title="AU question: https://askubuntu.com/q/1027543/307523"
Percent=0
for f in /usr/bin/* ; do # 1000+ files so this is fake loop
echo "#$f" # Display file name in progress bar.
echo $Percent # Percent complete
Percent=$(( $Percent + 1 ))
[[ $Percent -gt 100 ]] && break
sleep .05 # Change to 2 seconds for OP's fake.
done | yad --progress --auto-close
--width=500 --height=300
--title="$title" --enable-log "Current filename"
--log-expanded --log-height=250
--log-on-top --percentage=0
--no-cancel --center
exit 0
The percentage is incremented by 1 in each iteration of the for
loop. It should be calculating percentage on 1,000+ files but stops after 100 files.
Why do you iterate over /usr/bin? Why not just usefor i in 1..100
ori=100; while ((--i))
?
â wjandrea
Apr 24 at 0:30
Two notes: 1) Use the newer command substitution syntax$()
instead of backticks, which are deprecated. 2) It would be cleaner to put theyad
options in an array.
â wjandrea
Apr 24 at 0:34
1
@wjandrea I looped through/usr/bin
to give some text to the progress display. I know backticks are frowned upon these days but it was old code I had laying around which I copied without doing a lot of work. I've removed them. Theyad
options in an array does clean up thedone
line but I think this method illustrates to newcomers what is going on with the pipe toyad
with all the details in one spot.
â WinEunuuchs2Unix
Apr 24 at 0:42
+1 for⦠a nice answer. ;D OP asked for the terminal to show some kind of process bar, which is why I concentrated on non-GUI solutions, but this is not at all detrimental to the usefulness of your approach. Thanks for sharing the knowledge!
â dessert
Apr 24 at 6:50
add a comment |Â
up vote
3
down vote
Fake Progress Bar
Here's my fake progress bar:
It uses yad
which is a super-charged version of zenity
the default GUI used in the terminal. To install yad
use:
sudo apt install yad
Here's the code you can copy and paste because everyone has the /usr/bin
directory:
#!/bin/bash
# NAME: yad-progress-bar
# PATH: $HOME/bin
# DESC: Display yad progress bar % with names.
# DATE: Apr 23, 2018.
title="AU question: https://askubuntu.com/q/1027543/307523"
Percent=0
for f in /usr/bin/* ; do # 1000+ files so this is fake loop
echo "#$f" # Display file name in progress bar.
echo $Percent # Percent complete
Percent=$(( $Percent + 1 ))
[[ $Percent -gt 100 ]] && break
sleep .05 # Change to 2 seconds for OP's fake.
done | yad --progress --auto-close
--width=500 --height=300
--title="$title" --enable-log "Current filename"
--log-expanded --log-height=250
--log-on-top --percentage=0
--no-cancel --center
exit 0
The percentage is incremented by 1 in each iteration of the for
loop. It should be calculating percentage on 1,000+ files but stops after 100 files.
Why do you iterate over /usr/bin? Why not just usefor i in 1..100
ori=100; while ((--i))
?
â wjandrea
Apr 24 at 0:30
Two notes: 1) Use the newer command substitution syntax$()
instead of backticks, which are deprecated. 2) It would be cleaner to put theyad
options in an array.
â wjandrea
Apr 24 at 0:34
1
@wjandrea I looped through/usr/bin
to give some text to the progress display. I know backticks are frowned upon these days but it was old code I had laying around which I copied without doing a lot of work. I've removed them. Theyad
options in an array does clean up thedone
line but I think this method illustrates to newcomers what is going on with the pipe toyad
with all the details in one spot.
â WinEunuuchs2Unix
Apr 24 at 0:42
+1 for⦠a nice answer. ;D OP asked for the terminal to show some kind of process bar, which is why I concentrated on non-GUI solutions, but this is not at all detrimental to the usefulness of your approach. Thanks for sharing the knowledge!
â dessert
Apr 24 at 6:50
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Fake Progress Bar
Here's my fake progress bar:
It uses yad
which is a super-charged version of zenity
the default GUI used in the terminal. To install yad
use:
sudo apt install yad
Here's the code you can copy and paste because everyone has the /usr/bin
directory:
#!/bin/bash
# NAME: yad-progress-bar
# PATH: $HOME/bin
# DESC: Display yad progress bar % with names.
# DATE: Apr 23, 2018.
title="AU question: https://askubuntu.com/q/1027543/307523"
Percent=0
for f in /usr/bin/* ; do # 1000+ files so this is fake loop
echo "#$f" # Display file name in progress bar.
echo $Percent # Percent complete
Percent=$(( $Percent + 1 ))
[[ $Percent -gt 100 ]] && break
sleep .05 # Change to 2 seconds for OP's fake.
done | yad --progress --auto-close
--width=500 --height=300
--title="$title" --enable-log "Current filename"
--log-expanded --log-height=250
--log-on-top --percentage=0
--no-cancel --center
exit 0
The percentage is incremented by 1 in each iteration of the for
loop. It should be calculating percentage on 1,000+ files but stops after 100 files.
Fake Progress Bar
Here's my fake progress bar:
It uses yad
which is a super-charged version of zenity
the default GUI used in the terminal. To install yad
use:
sudo apt install yad
Here's the code you can copy and paste because everyone has the /usr/bin
directory:
#!/bin/bash
# NAME: yad-progress-bar
# PATH: $HOME/bin
# DESC: Display yad progress bar % with names.
# DATE: Apr 23, 2018.
title="AU question: https://askubuntu.com/q/1027543/307523"
Percent=0
for f in /usr/bin/* ; do # 1000+ files so this is fake loop
echo "#$f" # Display file name in progress bar.
echo $Percent # Percent complete
Percent=$(( $Percent + 1 ))
[[ $Percent -gt 100 ]] && break
sleep .05 # Change to 2 seconds for OP's fake.
done | yad --progress --auto-close
--width=500 --height=300
--title="$title" --enable-log "Current filename"
--log-expanded --log-height=250
--log-on-top --percentage=0
--no-cancel --center
exit 0
The percentage is incremented by 1 in each iteration of the for
loop. It should be calculating percentage on 1,000+ files but stops after 100 files.
edited Apr 24 at 1:12
![](https://i.stack.imgur.com/eVuAv.png?s=32&g=1)
![](https://i.stack.imgur.com/eVuAv.png?s=32&g=1)
wjandrea
7,15242255
7,15242255
answered Apr 23 at 23:29
![](https://i.stack.imgur.com/2SXNl.jpg?s=32&g=1)
![](https://i.stack.imgur.com/2SXNl.jpg?s=32&g=1)
WinEunuuchs2Unix
35.6k759133
35.6k759133
Why do you iterate over /usr/bin? Why not just usefor i in 1..100
ori=100; while ((--i))
?
â wjandrea
Apr 24 at 0:30
Two notes: 1) Use the newer command substitution syntax$()
instead of backticks, which are deprecated. 2) It would be cleaner to put theyad
options in an array.
â wjandrea
Apr 24 at 0:34
1
@wjandrea I looped through/usr/bin
to give some text to the progress display. I know backticks are frowned upon these days but it was old code I had laying around which I copied without doing a lot of work. I've removed them. Theyad
options in an array does clean up thedone
line but I think this method illustrates to newcomers what is going on with the pipe toyad
with all the details in one spot.
â WinEunuuchs2Unix
Apr 24 at 0:42
+1 for⦠a nice answer. ;D OP asked for the terminal to show some kind of process bar, which is why I concentrated on non-GUI solutions, but this is not at all detrimental to the usefulness of your approach. Thanks for sharing the knowledge!
â dessert
Apr 24 at 6:50
add a comment |Â
Why do you iterate over /usr/bin? Why not just usefor i in 1..100
ori=100; while ((--i))
?
â wjandrea
Apr 24 at 0:30
Two notes: 1) Use the newer command substitution syntax$()
instead of backticks, which are deprecated. 2) It would be cleaner to put theyad
options in an array.
â wjandrea
Apr 24 at 0:34
1
@wjandrea I looped through/usr/bin
to give some text to the progress display. I know backticks are frowned upon these days but it was old code I had laying around which I copied without doing a lot of work. I've removed them. Theyad
options in an array does clean up thedone
line but I think this method illustrates to newcomers what is going on with the pipe toyad
with all the details in one spot.
â WinEunuuchs2Unix
Apr 24 at 0:42
+1 for⦠a nice answer. ;D OP asked for the terminal to show some kind of process bar, which is why I concentrated on non-GUI solutions, but this is not at all detrimental to the usefulness of your approach. Thanks for sharing the knowledge!
â dessert
Apr 24 at 6:50
Why do you iterate over /usr/bin? Why not just use
for i in 1..100
or i=100; while ((--i))
?â wjandrea
Apr 24 at 0:30
Why do you iterate over /usr/bin? Why not just use
for i in 1..100
or i=100; while ((--i))
?â wjandrea
Apr 24 at 0:30
Two notes: 1) Use the newer command substitution syntax
$()
instead of backticks, which are deprecated. 2) It would be cleaner to put the yad
options in an array.â wjandrea
Apr 24 at 0:34
Two notes: 1) Use the newer command substitution syntax
$()
instead of backticks, which are deprecated. 2) It would be cleaner to put the yad
options in an array.â wjandrea
Apr 24 at 0:34
1
1
@wjandrea I looped through
/usr/bin
to give some text to the progress display. I know backticks are frowned upon these days but it was old code I had laying around which I copied without doing a lot of work. I've removed them. The yad
options in an array does clean up the done
line but I think this method illustrates to newcomers what is going on with the pipe to yad
with all the details in one spot.â WinEunuuchs2Unix
Apr 24 at 0:42
@wjandrea I looped through
/usr/bin
to give some text to the progress display. I know backticks are frowned upon these days but it was old code I had laying around which I copied without doing a lot of work. I've removed them. The yad
options in an array does clean up the done
line but I think this method illustrates to newcomers what is going on with the pipe to yad
with all the details in one spot.â WinEunuuchs2Unix
Apr 24 at 0:42
+1 for⦠a nice answer. ;D OP asked for the terminal to show some kind of process bar, which is why I concentrated on non-GUI solutions, but this is not at all detrimental to the usefulness of your approach. Thanks for sharing the knowledge!
â dessert
Apr 24 at 6:50
+1 for⦠a nice answer. ;D OP asked for the terminal to show some kind of process bar, which is why I concentrated on non-GUI solutions, but this is not at all detrimental to the usefulness of your approach. Thanks for sharing the knowledge!
â dessert
Apr 24 at 6:50
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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%2faskubuntu.com%2fquestions%2f1027543%2fhow-do-i-create-a-fake-process-bar%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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
See How to add a progress bar to a shell script? - Stack Overflow
â wjandrea
Apr 23 at 18:11
3
Possible duplicate of Create a progress bar in bash
â wjandrea
Apr 23 at 18:12
6
To reviewers: IMO this is neither unclear nor a duplicate to the linked question, it asks precisely for a fake progress bar and is quite clear about the fake data. If you consider this unclear nevertheless, please add a comment explaining how OP can improve the question.
â dessert
Apr 23 at 18:49
1
@dessert Re my dupe flag, I don't see how a fake progress bar is different from a real one. Edit: after reading your answer, I think I get it, but I could still use some clarity.
â wjandrea
Apr 23 at 20:20
1
Most of the progress bar examples I've seen online are fake in the first place so people can copy and paste them :)
â WinEunuuchs2Unix
Apr 23 at 21:44