Results 1 to 3 of 3
Hi Guys,
I working on a linux shell script to show the progress of a command.
I am trying to use the dialog gauge option for showing this progress, but ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-12-2012 #1Just Joined!
- Join Date
- Nov 2012
- Posts
- 3
Using dialog in bash scripts
Hi Guys,
I working on a linux shell script to show the progress of a command.
I am trying to use the dialog gauge option for showing this progress, but am having some difficulties in using it. Here is my need
I have a function named createdir() which does this
function createdir() {
mkdir -p /usr/local/httpd
mkdir -p /usr/local/tomcat
mkdir -p /usr/local/pcre
}
I wanted to use this in a dialog and show the progress percentage untill the mkdir process is completed. ie., I want both the mkdir command to execute at the same time need to progress gauge to show the completed percentage, when the above three commands are fininshed my gauge percentage should be 100%.
how do I do this with the shell script.
- 11-13-2012 #2Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 396
mkdir takes no time so short (0.001 seconds) this is not a good use.
Also you can make all three directories in one command:
or evenCode:mkdir -p /usr/local/{httpd,tomcat,pcre}
Code:mkdir -p /usr/local/httpd /usr/local/tomcat /usr/local/pcre
- 11-21-2012 #3Just Joined!
- Join Date
- Nov 2012
- Posts
- 31
Though I think those commands will happen almost instantly. could be simple as putting a print ".."; after each command. with a print "["; before and print "]"; after. (usually what those ticks are) however if you wish the ticks and the simultaneous commands as alf55 suggests, then how about generating ticks in confirming the directories are created, either after perl->shell commands or on a different thread, with a clock cycle till all were created. (would also slow down the [......] enough to be a visual.) in case the stipulation was handed down. nearly 9 times the code already written... while loop with local flag variable to discount the directories already verified.


Reply With Quote
