Programming :: Progress Bar Instead Of Percentage Complete For Loop

Nov 25, 2010

I've got a loop which is able to echo out how complete a process is after each loop (e.g says 25% if the loop has 4 elements and has run once through). Is there any way I can print characters, perhaps a progress bar? I was thinking of using the percentage as a count or something and using.

Code:
I got told off for including code from work here.

View 14 Replies


ADVERTISEMENT

Programming :: Copy At Terminal With Progress Bar

Mar 9, 2009

After searching I cant find script that can deal with directories. All the found scripts work file to file and not directory to directory. Someone know script that can deal with all this situation?

View 8 Replies View Related

Programming :: Cannot Capture SCP Progress Bar In Output Redirect

Oct 31, 2010

I would really like to capture the output of scp and my file's progress. Scp updates the transfer rate every 1 second, and I will like to save the transfer rate at every update. So for example, if the file transfer takes 30 seconds, I would like 30 reports of the transfer rate.

The output looks like:
Code:
file.dat 1% 3664KB 938.5KB/s 05:48

Whenever I try a simple redirect like:
Code:
scp file.dat 192.168.1.100:~/ &> output
... it does not save the rate at every update, it only shows the final rate.

If I try using typescript by starting "script" ... it's the same deal.

View 7 Replies View Related

Programming :: Rsync Bash Script With Progress Bar?

Apr 26, 2009

I'm writing a script to automate rsync backups which so far is working great. I prefer to send output to a text file instead of watching it fly by but the blank output is slightly boring? I would love to use a progress bar. Not for each file but for overall progress. Something like

syncing /home directory 50% [++++++++]

I already know it's way over my head and maybe bash isn't even the right tool for the job.

View 4 Replies View Related

Programming :: How To Get Zenity Progress Bar Working Properly

Apr 14, 2011

I am busy writing this script to get a pixel count of a large batch of images in a directory for a research project. To do this I'm using a loop to get all the images in the directory. To make the whole procedure more user friendly for some colleagues I decided to use zenity, something I haven't yet really worked with. As not to make sure that the users don't have to watch to this blank screen during the actual processing of the images I'm trying to get the zenity progress bar working. So far the progress bar comes up but instead of changing over time it stays "empty" till all the images are processed and then becomes 100% when all images are done. What servers my needs for now, but since I am trying to learn more about zenity I was wondering how I could change the script to get the progress bar properly working? Below is the piece of script I am talking about.

Code:
cd $input #goto path of image directory
(for a in *jpg *JPG *jpeg *JPEG; do
if [ -f "$a" ]; then #was it a image file
b="$a" #set b to $a
convert -resize 1000x1000! ${b} -depth 1 -format %c histogram:info:$b.txt #get pixelcount and write to .txt file
fi
done) | zenity --progress

View 2 Replies View Related

Programming :: SED Processing - Export Progress Bar From Wget Display

Nov 2, 2010

I am attempting to "export" the progress bar from wget display using sed. Basically, we have an app that starts wget to download a large file and we want to show a progress bar. Our application has a dbus interface to receive the download progress.

So we were think of a command like:
wget [] | sed [] | dbus-send[]
The problem at the moment is, how do you get the matched string out of sed and into dbus-send? I can get the progress string by:
sed -u 's/[0-9]*%/&/'

This populated '&' with the correct percentage, but I cannot seem to get this out of sed.

View 9 Replies View Related

Programming :: Bash Programming - Rename Files In A Loop?

Mar 31, 2011

I need to rename the resulted searched files from a loopI have the following code:

find . -name DOC* | while read i
do
find $i -type f -name '*.txt'
done

basically, I am searching for all txt files inside any folder starting with DOC name.this code is working fine with me.I need to rename those .txt files to .txtOLDOS: Ubuntu 10.4Bash shell

View 10 Replies View Related

Programming :: Custom Progress Bar Of Video Conversion Script (FLV To XVID)

Aug 7, 2010

i have written a bash script to convert flv files (e.g. videos) to xvid to be played on my dvd player. the conversion is not really the issue, as it works. what i am dealing with now are 2 problems i have not found a good workarouond:
1. surpressing the shell output of mencoder completely ( i do not want to see all the mencoder messages). this i have only solved to a certain extend.
2. i want to create a progress bar. this one i have not yet cracked.

the script:
code:
#!/bin/bash
## settings
v_bitrate=768
video_opts="-ovc xvid -xvidencopts bitrate=$v_bitrate:autoaspect"
audio_opts="-oac mp3lame -lameopts fast:preset=standard"
store_dir=./converted_files .....

#start the script
main_menu
1. mencoder output: using /dev/null works more or less. for example: if mencoder detects a double frame while converting, a message is still printed on the bash screen
2. progressbar: i have no clue yet on how to do this. any link or tip is welcome.
my goal is something like this:
[56%] [time in progress] [timeleft]

View 7 Replies View Related

Programming :: Broken Do While Loop?

Feb 9, 2011

i can not figure out why my program does not terminate if i type n when i read loop unless it is the last if statement in my program ?

while [ "$loop" = y ] ; do
echo "what does baket mean: " ; read word
if [ "$word" = why ]

[code]....

View 3 Replies View Related

Programming :: C++ Loop Windows ?

Oct 3, 2010

Here is my code

Code:

I just cant seem to understand loops. i havent put the loop in yet but what i would like is the user only to have 3 tries at guessing number then exit if wrong or it says "correct if right" tbh i dont even know if the above code is correct. i have tried several ways and position of the loops but each time is comes out wrong

View 7 Replies View Related

Programming :: Variable Is Gone At The End Of While Loop?

Mar 25, 2011

I have a directory file capturing script, the variable is fine with in the loop but gone after the loop is done:

Code:
DIR="/usb/sdb1/media/music/"
i=1

[code]...

View 9 Replies View Related

Programming :: Variable Name Change In A Loop?

Apr 24, 2010

I am about to move my scripts to the next generation level, so I need some help I am stuck in varying my variable names in a loop. For example:

for user in ben dorothy mike pat
do
[ -r /home/$user ] && let "$user"check=1 || let "$user"check=0

[code]...

View 1 Replies View Related

General :: Shell Programming Using While Loop

Jun 28, 2010

I am trying to do some shell programs. I tried some sites regarding the while loop, they give the structure as:
Code:
while [ n1 -lt 500 ]
do
echo $((n1+100))
done

But the below code also worked for me:
Code:
while ((n1 > 500))
do
echo $((n1+100))
done
By using (( )) I could use while, for. But the documentations didnt follow this way. I mainly use this for datastructure programming.

View 4 Replies View Related

Programming :: C Language - For Loop That Just Keeps On Running?

Aug 1, 2010

In the code segment below is a for loop I am having some considerable difficulty with. It just keeps iterating endlessly and totally ignores the 70 times limit specified. I can't ever remember having this problem before and am absolutely Clueless.

Code:
for ( x = 0; x < 70; x++ )
{
fputs ("CSN00", target);
fprintf (target, "%d", userid);

[Code].....

View 14 Replies View Related

Programming :: Error Codes In A For Loop

Nov 3, 2010

I've got a 'nested' for loop which has a grep in it, if the grep fails there's no output - however the error code is still $0 and the second for loop is still entered, there's also a grep in the second for loop.I guess ultimately what i need to know is whether there's a way of making grep generate an error code. when no results are found?

View 14 Replies View Related

Programming :: Loop Through Records In A File?

Apr 23, 2011

I want to loop through the records in the below file (homedir.temp)
/home/user1
/home/user2
/home/user3

I want to do the following activities with each record1. du -s - to get the total usage for that directory (my variable name is SIZE)2. divide SIZE by du -c for /home to get the percentage of usage. (my variable name is PER)3. write the directory, SIZE, PER to a filePROBLEMI am using the below for loop: for record in homedir.tempthe mentioned activitiesdonehe above is not looping through the records. It does the first record perfectly and exits the loop.

View 14 Replies View Related

Programming :: Read A File With A While Loop?

Apr 25, 2010

ITT and am just lurning about scripting and need to read a file and output the file to the screen. We need to do this with a while loop.

View 5 Replies View Related

Programming :: FTP Error - 550 Operation Not Complete

Apr 5, 2010

i am having problem with the following code(trying to updoad a file):

Code:

HINTERNET internet;
HINTERNET ftp;
internet = InternetOpen(NULL , INTERNET_OPEN_TYPE_DIRECT , NULL , NULL , 0);
ftp = InternetConnect(internet , "127.0.0.1" , INTERNET_DEFAULT_FTP_PORT , NULL , NULL , INTERNET_SERVICE_FTP , 0 , 0);

[code]...

so FtpPutFile returns the following error:

Code:

12003
200 Type set to I.
200 PORT Command successful.
550 Operation not complete

View 2 Replies View Related

Programming :: Can't Access To Content Of Array In For Loop

Mar 7, 2010

When I deal with an array in a function I con not access to the content of array in a for loop, but out of a for loop I can access to them! for example

[code]...

In a function when I send as parameter, in a for loop it prints the content of array and out of a for loop it prints the address of arr[i]

View 5 Replies View Related

Programming :: Bash For Loop - All Responses On One Line

Nov 18, 2010

I'm writing a mass snmp toner check which polls any toners available to be snmp polled, however when using a loop statement I get the results on different lines; which sounds good, however the tool I use to check with (nagios) ignores the new lines.

Is there any way I can get the output on one line? Also, I need to raise a fault if any of the toners are below a specific level (with nagios you raise faults with the exit code) - any way I can do this without exiting the loop. Code below with bits and bobs commented out.

Code:
check_ink_levels ()
{
for ID in $INKS
do

[Code].....

View 10 Replies View Related

Programming :: Conditional Foreach Loop In Perl?

Jun 1, 2010

#!/usr/bin/perl -w
use strict;
my @files = `ls -1`;

[code]...

View 2 Replies View Related

Programming :: Fortran How To Open A File In Loop

Jun 29, 2011

I have a 50 file name NSSAVE0001.vtk to NSSAVE0050.vtk.Do I have to manually type individually command to open each file or can I have a loop to open file?

View 3 Replies View Related

Programming :: Take A List From A File And Use It In A For Loop In Python?

May 11, 2009

so far I have this

list = open('list.txt')
for x in list:
list.read(x)

View 3 Replies View Related

Programming :: Pass Arguments To A Function Using A Loop

Mar 1, 2010

I need to pass a large number of arguments to a function which takes variable number of arguments, such as gtk_list_store_new. But it doesn't look nice if i write something like gtk_list_store_new(NUM,TYPE_A,TYPE_B,TYPE_C,...,TYPE_OMEGA); because of large number of arguments. And, it will be a trouble to change number of columns because of need to manually change arguments to large number of such functions. So, how can i pass all the arguments to a function using a loop? Something like

Code:
for(i=0;i<NUM;i++)
{
push_arg(args[i]);
}
call_function(func);
?

Of course, i could just use asm code for this, but is there a portable way of doing so?

P.S. i mean C language.

View 2 Replies View Related

Programming :: Imagemagick With For Loop On The Commandline Does Not Work

May 26, 2011

I have images in jpg format

Code:

CIMG0100.jpg
...
...
CIMG0131.jpg

I used imagemagick to convert the files to gif with the following command

Code:

for i in {100..131}; do convert CIMG0$i.jpg CIMG0$i.gif; done # works

This worked like expected, but when afterwards I wanted to scale the images

Code:

for i in {100..131}; do convert -scale 25% CIMG00$i.gif CIMG00$i_scaled.gif; done # works not it seems the system is working for about half a minute, but I get no output. The single command

Code:

convert -scale 25% CIMG100.gif CIMG100_scaled.gif # works

works as expected and gives me a scaled image. What does the convert command do in the second case? is the for-loop wrong?

View 2 Replies View Related

Programming :: Loop Produces Wierd Numbers

Aug 13, 2010

I'm learning c but then when i tried looping as i follow a tutorial, the numbers are wierd that it seems not right..

This is the example.

Quote:

When i run it, it outputs this.

Quote:

why?

View 2 Replies View Related

Programming :: Loop To Process Entries In A File?

Jul 9, 2010

I hade created a file with following text entries.

content of fileitems.txt
kdeaccessibility-4.4.92
kdeadmin-4.4.92
kdeartwork-4.4.92
kdebase-4.4.92

How do I read the file one line at a time and so its ready to do something with that line.

View 3 Replies View Related

Programming :: Unable To Execute FOR Loop In Shell?

Apr 19, 2011

hint me why and how to execute the below for loop, the way i am trying to?

[bkcreddy17@local:~]$ cat -n test
1 date
2 ls -l

[code]...

View 14 Replies View Related

Programming :: Comparison And Breaking Out Of Loop Java?

Oct 10, 2010

my issue is that the when i put in the correct input its going into the loop like i put in incorrect input and wont break out of the loop even with the correct input entered

Code:
import java.util.*;
import javax.swing.*;

[code]...

View 3 Replies View Related

Programming :: Run SQL Update Statement In A For Loop In Bash?

Jun 7, 2010

The script that Iam trying to write is running a for loop and reading line by line from a text file. inside this for loop i would like to execute update SQL statement .

a pesudo code is
Quote:
`$ISQL -U $username -P $Password -D $Dbname -I $INTERFACE <<QRY
for id in $idlist #idlist iam reading from a file

[code]...

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved