Bluehost.com Web Hosting $6.95

Bash progress bar command like in g4u (BSD)

This is a discussion on Bash progress bar command like in g4u (BSD) within the Linux General forums, part of the Linux Forums category; I'm trying to get the g4u scripts running on debian machines. I've got it all running now expect ...


Go Back   Usenet Forums > Linux Forums > Linux General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-24-2005
Wunsch
 
Posts: n/a
Default Bash progress bar command like in g4u (BSD)

I'm trying to get the g4u scripts running on debian machines. I've got
it all running now expect for a fancy progress bar.

The original g4u uses 'progress' to get a progress bar of the data pipe:

ftp -o "| progress -z dd obs=1M of=/dev/${diskpart}" ftp.....

I can't find this program for linux. I have found the program 'bar' but
there's no debian package for it and I would like to be able to use it
out of the box.

So anyone a clue how to accomplish this progress bar on the data pipe in
bash?

Rg,

Arnaud Loonstra
Reply With Quote
  #2 (permalink)  
Old 05-24-2005
Tony Lawrence
 
Posts: n/a
Default Re: Bash progress bar command like in g4u (BSD)

Wunsch wrote:
> I'm trying to get the g4u scripts running on debian machines. I've got
> it all running now expect for a fancy progress bar.
>
> The original g4u uses 'progress' to get a progress bar of the data pipe:
>
> ftp -o "| progress -z dd obs=1M of=/dev/${diskpart}" ftp.....
>
> I can't find this program for linux. I have found the program 'bar' but
> there's no debian package for it and I would like to be able to use it
> out of the box.
>
> So anyone a clue how to accomplish this progress bar on the data pipe in
> bash?
>
> Rg,
>
> Arnaud Loonstra



dialog maybe ?


http://aplawrence.com/Words2005/2005_03_08.html



--
Tony Lawrence
Unix/Linux/Mac OS X resources: http://aplawrence.com
Reply With Quote
  #3 (permalink)  
Old 05-24-2005
Wunsch
 
Posts: n/a
Default Re: Bash progress bar command like in g4u (BSD)

Tony Lawrence wrote:
> Wunsch wrote:
>
>> I'm trying to get the g4u scripts running on debian machines. I've got
>> it all running now expect for a fancy progress bar.
>>
>> The original g4u uses 'progress' to get a progress bar of the data pipe:
>>
>> ftp -o "| progress -z dd obs=1M of=/dev/${diskpart}" ftp.....
>>
>> I can't find this program for linux. I have found the program 'bar'
>> but there's no debian package for it and I would like to be able to
>> use it out of the box.
>>
>> So anyone a clue how to accomplish this progress bar on the data pipe
>> in bash?
>>
>> Rg,
>>
>> Arnaud Loonstra

>
>
>
> dialog maybe ?
>
>
> http://aplawrence.com/Words2005/2005_03_08.html
>


From what I've seen of it it doesn't support stdin & stdout, it needs a
counter to get a gauge progress bar.

I've tried 'bar' now and it could do the job only it doens't work with
lukemftp for some reason. It did work with ncftp but I want a user input
of the password.

http://clpbar.sourceforge.net/

if I could only get the original 'progress' command which is used on
NetBSD.

Arnaud.
Reply With Quote
  #4 (permalink)  
Old 05-24-2005
ynotssor
 
Posts: n/a
Default Re: Bash progress bar command like in g4u (BSD)

In article <d9a83$42933725$c2abce6b$7787@news1.tudelft.nl>
Wunsch <nospam@svp> wrote:

> >> So anyone a clue how to accomplish this progress bar on the data pipe
> >> in bash?

[...]
> if I could only get the original 'progress' command which is used on
> NetBSD.


http://freshmeat.net/projects/progress/

Reply With Quote
  #5 (permalink)  
Old 05-25-2005
A.J. Loonstra
 
Posts: n/a
Default Re: Bash progress bar command like in g4u (BSD)

ynotssor wrote:
> In article <d9a83$42933725$c2abce6b$7787@news1.tudelft.nl>
> Wunsch <nospam@svp> wrote:
>
>
>>>>So anyone a clue how to accomplish this progress bar on the data pipe
>>>>in bash?

>
> [...]
>
>>if I could only get the original 'progress' command which is used on
>>NetBSD.

>
>
> http://freshmeat.net/projects/progress/
>


Hmmm, I strange I didn't find it myself... I'll try this out.

Thnx,

Arnaud.
Reply With Quote
  #6 (permalink)  
Old 05-26-2005
A.J. Loonstra
 
Posts: n/a
Default Re: Bash progress bar command like in g4u (BSD)

ynotssor wrote:
> In article <d9a83$42933725$c2abce6b$7787@news1.tudelft.nl>
> Wunsch <nospam@svp> wrote:
>
>
>>>>So anyone a clue how to accomplish this progress bar on the data pipe
>>>>in bash?

>
> [...]
>
>>if I could only get the original 'progress' command which is used on
>>NetBSD.

>
>
> http://freshmeat.net/projects/progress/
>


Nope it works ok but it's nothing more than hash in ftp..
it just prints out a dot for every n bytes...

I did try the bar command which works ok but it doens't work with
supplying a password interactively...

I tried contacting the developer of lukemftp since progress on NetBSD is
developed together with it's ftp command but misses in lukemftp. Even
the man page is referring to it.

The search continues...

Arnaud.
Reply With Quote
  #7 (permalink)  
Old 05-26-2005
ynotssor
 
Posts: n/a
Default Re: Bash progress bar command like in g4u (BSD)

In article <1199vf87btth9dc@corp.supernews.com> A.J. Loonstra
<arnaud@#nospam#.sphaero.org> wrote:

> >> if I could only get the original 'progress' command which is used on
> >> NetBSD.

> > http://freshmeat.net/projects/progress/


> Nope it works ok but it's nothing more than hash in ftp..
> it just prints out a dot for every n bytes...


> I did try the bar command which works ok but it doens't work with
> supplying a password interactively...


> I tried contacting the developer of lukemftp since progress on NetBSD is
> developed together with it's ftp command but misses in lukemftp. Even
> the man page is referring to it.


> The search continues...


A quick look at the package repository for NetBSD shows that it's
just a Perl construct: http://search.cpan.org/dist/Term-ProgressBar
Reply With Quote
  #8 (permalink)  
Old 05-26-2005
Wunsch
 
Posts: n/a
Default Re: Bash progress bar command like in g4u (BSD)

ynotssor wrote:
>
>>The search continues...

>
>
> A quick look at the package repository for NetBSD shows that it's
> just a Perl construct: http://search.cpan.org/dist/Term-ProgressBar


Nope it's this:

http://cvsweb.netbsd.org/bsdweb.cgi/....bin/progress/

But I tried to compile it didn't work. Progress is also developed by the
author of Lukemftp and I think it uses progressbar.c/h from lukemftp.

I've gotten in touch with the author of Lukemftp, I'll see what he says.

Arnaud.
Reply With Quote
  #9 (permalink)  
Old 05-27-2005
Dave Gibson
 
Posts: n/a
Default Re: Bash progress bar command like in g4u (BSD)

Wunsch <nospam@svp> wrote:
[looking for port of NetBSD's progress to Linux, no joy yet]
> Nope it's this:
>
> http://cvsweb.netbsd.org/bsdweb.cgi/....bin/progress/
>
> But I tried to compile it didn't work. Progress is also developed by the
> author of Lukemftp and I think it uses progressbar.c/h from lukemftp.


Fetch these:

http://cvsweb.netbsd.org/bsdweb.cgi/.../progressbar.h
http://cvsweb.netbsd.org/bsdweb.cgi/.../progressbar.c
http://cvsweb.netbsd.org/bsdweb.cgi/...ess/progress.c
http://cvsweb.netbsd.org/bsdweb.cgi/...ess/progress.1

Apply this patch (patch -p 1 < this_thing):

[patch begins on next line]
diff -uNr progress.orig/Makefile progress/Makefile
--- progress.orig/Makefile 1970-01-01 01:00:00.000000000 +0100
+++ progress/Makefile 2005-05-24 21:31:13.000000000 +0100
@@ -0,0 +1,5 @@
+DEFS=-D_GNU_SOURCE -DSTANDALONE_PROGRESS -Dlint -DSECSPERHOUR=3600
+CFLAGS=-I. -Wall -O2 $(DEFS)
+
+progress: progress.c progressbar.c
+ $(CC) $(CFLAGS) -o $@ $^
diff -uNr progress.orig/progress.c progress/progress.c
--- progress.orig/progress.c 2004-03-09 17:04:24.000000000 +0000
+++ progress/progress.c 2005-05-24 21:07:18.000000000 +0100
@@ -45,6 +45,14 @@
#include <sys/wait.h>
#include <netinet/in.h>
#include <arpa/ftp.h>
+#ifdef __linux__
+#include <sys/stat.h>
+#define setprogname(a) /* nothing */
+#define getprogname() program_invocation_short_name
+#define ttysize winsize
+#define TIOCGSIZE TIOCGWINSZ
+#define ts_cols ws_col
+#endif

#include <ctype.h>
#include <err.h>
diff -uNr progress.orig/progressbar.c progress/progressbar.c
--- progress.orig/progressbar.c 2004-03-09 17:04:24.000000000 +0000
+++ progress/progressbar.c 2005-05-24 21:06:54.000000000 +0100
@@ -56,6 +56,9 @@
#include <time.h>
#include <tzfile.h>
#include <unistd.h>
+#ifdef __linux__
+#include <sys/time.h>
+#endif

#include "progressbar.h"

diff -uNr progress.orig/tzfile.h progress/tzfile.h
--- progress.orig/tzfile.h 1970-01-01 01:00:00.000000000 +0100
+++ progress/tzfile.h 2005-05-24 21:07:56.000000000 +0100
@@ -0,0 +1 @@
+/* dummy tzfile.h */
[patch ends on previous line]

Then make. If make complains about a missing separator, check that
the line in Makefile containing "$(CC) $(CFLAGS) -o $@ $^" begins
with a tab character.

Note: you'll need to use '--' in the command line before the name
of the program you want to feed data to.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:54 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0