# Question about progress(1)



## Phishfry (Dec 10, 2016)

I am looking for information on progress(1). This is Netbsd only? No pipeview in FreeBSD either?
https://www.freebsd.org/cgi/man.cgi?query=progress&manpath=NetBSD+6.0

Looking at the source directory I see progress.c and it is used by camcontrol. Is there a substitute program that should be used instead?
Could anybody show me other methods for progress?


----------



## Phishfry (Dec 10, 2016)

Tried compiling from source and it fails as I don't know what to link to. Are there clues in progress.c or progress.h what library to link to?

```
root@Testing:/usr/src/sbin/camcontrol # cc -o progress progress.c
/usr/lib/crt1.o: In function `_start':
/usr/src/lib/csu/amd64/crt1.c:(.text+0x17b): undefined reference to `main'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
```


----------



## Phishfry (Dec 10, 2016)

Would looking at crt1.o or crt1.c have the clues?


----------



## kpa (Dec 11, 2016)

You're trying to compile a working executable without a main() function anywhere in the source, that's not going to work. The progress_*() functions in progress.c are supposed to be used as library functions in camcontrol(8) and the main() function is provided by the main source file camcontrol.c. You need to write your own "driver" program that provides the main() function and calls the progress_*() functions.


----------



## tobik@ (Dec 11, 2016)

You can grab a copy of progress(1) that compiles on FreeBSD from here: https://github.com/t6/progress


----------



## Phishfry (Dec 11, 2016)

Works like a charm. Thanks so much.

```
root@Testing:~ # git clone https://github.com/t6/progress.git /root/progress
Cloning into '/root/progress'...
remote: Counting objects: 17, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 17 (delta 4), reused 17 (delta 4), pack-reused 0
Unpacking objects: 100% (17/17), done.
root@Testing:~ # cd /root/progress
root@Testing:~/progress # make
echo progress.full: /usr/lib/libc.a  >> .depend
Warning: Object directory not changed from original /root/progress
cc  -O2 -pipe -DSTANDALONE_PROGRESS -D__dead=__dead2 -DSECSPERHOUR=3600 -D_DIAGASSERT=assert   -g -MD  -MF.depend.progress.o -MTprogress.o -std=gnu99 -fstack-protector-strong    -Qunused-arguments  -c progress.c -o progress.o
cc  -O2 -pipe -DSTANDALONE_PROGRESS -D__dead=__dead2 -DSECSPERHOUR=3600 -D_DIAGASSERT=assert   -g -MD  -MF.depend.progressbar.o -MTprogressbar.o -std=gnu99 -fstack-protector-strong    -Qunused-arguments  -c progressbar.c -o progressbar.o
cc -O2 -pipe -DSTANDALONE_PROGRESS -D__dead=__dead2 -DSECSPERHOUR=3600 -D_DIAGASSERT=assert -g -std=gnu99 -fstack-protector-strong -Qunused-arguments  -o progress.full progress.o progressbar.o 
objcopy --only-keep-debug progress.full progress.debug
objcopy --strip-debug --add-gnu-debuglink=progress.debug  progress.full progress
gzip -cn progress.1 > progress.1.gz
root@Testing:~/progress # ls
.depend           progress       progress.o
.depend.progress.o   progress.1       progressbar.c
.depend.progressbar.o   progress.1.gz       progressbar.h
.git           progress.c       progressbar.o
.gitignore       progress.debug       strsuftoll.c
Makefile       progress.full
root@Testing:~/progress # progress
progress: Command not found.
root@Testing:~/progress # ./progress
usage: progress [-ez] [-b buffersize] [-f file] [-l length]
                [-p prefix] cmd [args...]
```


----------

