Find the answer to your Linux question:
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.
  1. #1
    Just 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.

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

  3. #3
    Just Joined!
    Join Date
    Nov 2012
    Posts
    40
    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
    $spacer_close

Posting Permissions

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