Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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.

  2. #2
    Linux Engineer
    Join Date
    Jan 2005
    Saint Paul, MN
    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:
    mkdir -p /usr/local/{httpd,tomcat,pcre}
    or even
    mkdir -p /usr/local/httpd /usr/local/tomcat /usr/local/pcre

  3. #3
    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.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts