1. 12

  2. 12

    Nice! Regarding pv(1), I recently noticed that OpenBSD uses ftp(1) to create arbitrary progress bars. For example to get a progress bar when extracting tarballs, you can do:

    $ ftp -VmD "Extracting" -o - file:archive.tgz | tar -zxf -
    Extracting archive.tgz 100% |*********************| 7580 KB    00:00

    It’s a clever trick that turns ftp(1) into cat(1) with a progress bar. The interface for pv(1) is much nicer, but sometimes it’s nice to use tools that are in the OpenBSD base install.

    This technique is also how OpenBSD displays the progress bars during install.

    1. 3

      I have mixed feeling about this. On one side, it is cool, but on the other side, it looks like ftp is becoming something else. For starters, it is called ftp while it is used for other protocols as well. Now a (cool) trick to make it work as a progress bar. Where’s the next stop? The init system!?! (just joking).

      1. 3

        …it is called ftp while it is used for other protocols…

        Well, the p stands for program, not protocol, these days 😉: http://man.openbsd.org/ftp

        The fact it supports locally mounted file systems is news to me! I never knew.

    2. 2

      This says:

      If you use GNU dd, there’s status=progress (for those on *BSD, sending SIGINFO displays the current status and there is no status=progress).

      However, FreeBSD’s dd also supports status=progress.

      1. 1

        Most of the time, if I’m in need of dd before encrypting a volume, it is the disk that I’m installing OpenBSD on. During installation, I don’t use pkg_add and keep going with the base. I would never dream of pkg_add pv or any other ports for that matter.