ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Where the variables are filled in by the user through dialog. What I want to do is
use gauge to show the file progress while it's creating and more importantly I
would like to understand WHY it works the way it does. I've played around a lot
with different things (using mkfifo, expr) and can get some amount of success but
since I don't understand what's going on I can't get any farther. Thanks.
the bailout function deletes some temp files, unmounts drives, etc.
Now, when I try to use this in my script it will start creating the file and the dialog pops up,
everything looks good until it get's to about 90% and it slows way down. I know the file is finished creating but gauge never gets to 100%. I don't know enough about the status="`expr`" line to know why this is happening. Can anyone offer any insight. Thanks for your time.
Thanks Hko, I understand it a lot better now. Like I said before I've been trying to get this to work with dd ( or mkfs, etc.) But now it seems that what one really has to do is to simply guess (thus the expr from the knoppix example above) in a way that makes it LOOK like it is keeping track of the current status of the file or whatever. This is a REALLY POOR soultion in my opinion. I have found a few ways that it's possible to know where dd is in the creation process. For instance I found while dd is running I can kill the process and by sending it -USR1 what it does is pause, display how far along it is and continue, sounds like just what I need. The problem though is that this of course stops the file creation for a moment and it seems that the overall overhead is not worth it. Another idea I had would be to have a seperate thread which would just keep doing a du on the file that is being created and compare it to the total filesize it's to create to and use this information to update gauge. Either way it would be more overhead. I havn't seen anyone else who actually checks for the real file progress. It SEEMS that EVERYONE just guesses. So I ask, what is the point of even having a progress bar if the information it displays is not accurate. Maybe I'm missing something here. As a final note I just want to say to everyone here at linuxquestions.org that this forum has become my first stop when looking for information(about Linux). I use to go to google first but I've recently started to realise that google always ends up pointing me back here. So just a big thanks to all of you.
quite an old thread and not sure if anyone watching anymore, but I'm trying to create a dialog gauge as well to show the progress of dd. Sending USR1 to the PID however outputs the statistics to standard error, making it hard to capture them.
I'm attaching a small archive with several examples using guage and progressbar which I created. As the last poster mentioned, most people use them with guessed values for the time it takes to perform a task. The only other way is to rpeatedly check the actual progress of the task -if possible. And doing so will slow down the process considerably.
What I usually wound up doing was using some sort of 'spinner' type thing. I've included some examples of that also. They simply display a changing set of characters which look like expanding stars or similar. If using Xdialog, you could even do something similar with a changing icon display.
The attached file is a tar.bz2 archive -just change the '.txt' to '.bz2' to be able to unpack it.
thx for your reply and your files. I looked at some, but you don't seem to link the progress of dd to dialog --gauge anywhere, is this right? Is there no way to do this? Because it standard error could be captured, it should be quite easy to calculate how much percent this is of the total file size.