This is pstree-2.36p1 as installed by the latest package on current/macppc (MacMini).
Running just pstree(1) by itself works fine, but piping or redirecting the output does not. For example, 'pstree | cat' or 'pstree | hexdump' or 'pstree > ps' result in just the newlines. Attached see a full script(1) of the session. It happens in both xterm and the console, but not on any other architecture I have. It works as expected on i386, amd64, and armv7. (See dmesg below). Am I missing something obvious? Jan [ using 549392 bytes of bsd ELF symbol table ] console out [ATY,RockHopper2_A]console in [keyboard] , using USB using parent ATY,RockHopper2Paren:: memaddr 98000000 size 8000000, : consaddr 9c008000, : ioaddr 90020000, size 20000: width 1280 linebytes 1280 height 1024 depth 8 Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. Copyright (c) 1995-2015 OpenBSD. All rights reserved. http://www.OpenBSD.org OpenBSD 5.7-current (GENERIC) #495: Wed Apr 29 12:44:18 MDT 2015 dera...@macppc.openbsd.org:/usr/src/sys/arch/macppc/compile/GENERIC real mem = 1073741824 (1024MB) avail mem = 1031028736 (983MB) mpath0 at root scsibus0 at mpath0: 256 targets mainbus0 at root: model PowerMac10,2 cpu0 at mainbus0: 7447A (Revision 0x102): 1499 MHz: 512KB L2 cache mem0 at mainbus0 spdmem0 at mem0: 1GB DDR SDRAM non-parity PC3200CL3.0 memc0 at mainbus0: uni-n rev 0xd2 "hw-clock" at memc0 not configured kiic0 at memc0 offset 0xf8001000 iic0 at kiic0 mpcpcibr0 at mainbus0 pci: uni-north pci0 at mpcpcibr0 bus 0 pchb0 at pci0 dev 11 function 0 "Apple UniNorth AGP" rev 0x00 radeondrm0 at pci0 dev 16 function 0 "ATI Radeon 9200" rev 0x01 drm0 at radeondrm0 radeondrm0: irq 48 mpcpcibr1 at mainbus0 pci: uni-north pci1 at mpcpcibr1 bus 0 macobio0 at pci1 dev 23 function 0 "Apple Intrepid" rev 0x00 openpic0 at macobio0 offset 0x40000: version 0x4614 feature 3f0302 LE macgpio0 at macobio0 offset 0x50 "modem-reset" at macgpio0 offset 0x1d not configured "modem-power" at macgpio0 offset 0x1c not configured macgpio1 at macgpio0 offset 0x9: irq 47 "programmer-switch" at macgpio0 offset 0x11 not configured "gpio5" at macgpio0 offset 0x6f not configured "gpio6" at macgpio0 offset 0x70 not configured "extint-gpio15" at macgpio0 offset 0x67 not configured "escc-legacy" at macobio0 offset 0x12000 not configured zsc0 at macobio0 offset 0x13000: irq 22,23 zstty0 at zsc0 channel 0 zstty1 at zsc0 channel 1 aoa0 at macobio0 offset 0x10000: irq 30,1,2 audio0 at aoa0 "timer" at macobio0 offset 0x15000 not configured adb0 at macobio0 offset 0x16000 apm0 at adb0: battery flags 0x0, 0% charged piic0 at adb0 iic1 at piic0 maxtmp0 at iic1 addr 0xc8: max6642 kiic1 at macobio0 offset 0x18000 iic2 at kiic1 wdc0 at macobio0 offset 0x20000 irq 24: DMA ohci0 at pci1 dev 26 function 0 "Apple Intrepid USB" rev 0x00: irq 29, version 1.0, legacy support ohci1 at pci1 dev 27 function 0 "NEC USB" rev 0x43: irq 63, version 1.0 ohci2 at pci1 dev 27 function 1 "NEC USB" rev 0x43: irq 63, version 1.0 ehci0 at pci1 dev 27 function 2 "NEC USB" rev 0x04: irq 63 usb0 at ehci0: USB revision 2.0 uhub0 at usb0 "NEC EHCI root hub" rev 2.00/1.00 addr 1 usb1 at ohci0: USB revision 1.0 uhub1 at usb1 "Apple OHCI root hub" rev 1.00/1.00 addr 1 usb2 at ohci1: USB revision 1.0 uhub2 at usb2 "NEC OHCI root hub" rev 1.00/1.00 addr 1 usb3 at ohci2: USB revision 1.0 uhub3 at usb3 "NEC OHCI root hub" rev 1.00/1.00 addr 1 mpcpcibr2 at mainbus0 pci: uni-north pci2 at mpcpcibr2 bus 0 kauaiata0 at pci2 dev 13 function 0 "Apple Intrepid ATA" rev 0x00 wdc1 at kauaiata0 irq 39: DMA wd0 at wdc1 channel 0 drive 0: <ST9160821A> wd0: 16-sector PIO, LBA48, 152627MB, 312581808 sectors wd0(wdc1:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 5 "Apple UniNorth Firewire" rev 0x81 at pci2 dev 14 function 0 not configured gem0 at pci2 dev 15 function 0 "Apple Uni-N2 GMAC" rev 0x80: irq 41, address 00:14:51:17:42:34 bmtphy0 at gem0 phy 0: BCM5221 100baseTX PHY, rev. 4 uhidev0 at uhub2 port 1 configuration 1 interface 0 "Logitech Optical USB Mouse" rev 2.00/3.40 addr 2 uhidev0: iclass 3/1 ums0 at uhidev0: 3 buttons, Z dir wsmouse0 at ums0 mux 0 uhidev1 at uhub3 port 1 configuration 1 interface 0 "Chicony USB Keyboard" rev 1.10/1.02 addr 2 uhidev1: iclass 3/1 ukbd0 at uhidev1: 8 variable keys, 6 key codes wskbd0 at ukbd0: console keyboard uhidev2 at uhub3 port 1 configuration 1 interface 1 "Chicony USB Keyboard" rev 1.10/1.02 addr 2 uhidev2: iclass 3/0, 3 report ids uhid0 at uhidev2 reportid 1: input=1, output=0, feature=0 uhid1 at uhidev2 reportid 2: input=1, output=0, feature=2 uhid2 at uhidev2 reportid 3: input=3, output=0, feature=0 vscsi0 at root scsibus1 at vscsi0: 256 targets softraid0 at root scsibus2 at softraid0: 256 targets bootpath: /pci@f4000000/ata-6@d/disk@0:/bsd root on wd0a (2e09198b7adf58b1.a) swap on wd0b dump on wd0b error: [drm:pid0:radeon_get_bios] *ERROR* Unable to locate a BIOS ROM trying to bind memory to uninitialized GART ! error: [drm:pid0:radeon_ttm_backend_bind] *ERROR* failed to bind 1 pages at 0x00000000 drm:pid0:radeon_wb_init *WARNING* (-22) create WB bo failed drm:pid0:r100_init *ERROR* Disabling GPU acceleration ttm_pool_mm_shrink_fini stub error: [drm:pid0:radeon_get_bios] *ERROR* Unable to locate a BIOS ROM radeon_i2c_put_byte stub radeon_i2c_put_byte stub radeon_i2c_put_byte stub radeon_i2c_put_byte stub radeon_i2c_put_byte stub radeondrm0: 1280x1024 wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd0 wsdisplay0: screen 1-5 added (std, vt100 emulation)
Script started on Sun May 10 18:49:20 2015 hans@ppc:~$ uname -a OpenBSD ppc.stare.cz 5.7 GENERIC#495 macppc hans@ppc:~$ hans@ppc:~$ pkg_info pstyree ree Information for inst:pstree-2.36p1 Comment: list processes as a tree Description: This is pstree. It is a small program that shows the ps listing as a tree (as the name implies...). It has several options to make selection criteria and to change the output style. For that it uses the output of /bin/ps. Maintainer: The OpenBSD ports mailing-list <ports@openbsd.org> WWW: http://www.thp.uni-duisburg.de/pstree/ hans@ppc:~$ hans@ppc:~$ hans@ppc:~$ pstree -+= 00001 root /sbin/init |-+= 00524 root syslogd: [priv] (syslogd) | \--- 11325 _syslogd /usr/sbin/syslogd |-+= 00703 root pflogd: [priv] (pflogd) | \--- 15453 _pflogd pflogd: [running] -s 160 -i pflog0 -f /var/log/pflog (pflogd) |-+= 11153 _ntp ntpd: ntp engine (ntpd) | \--= 31003 _ntp ntpd: dns engine (ntpd) |--= 29847 root ntpd: [priv] (ntpd) |-+= 04806 root /usr/sbin/sshd | |-+= 00233 root sshd: kucerjo3 [priv] (sshd) | | \-+- 20398 kucerjo3 sshd: kucerjo3@ttyp8 (sshd) | | \--= 12414 kucerjo3 -ksh (ksh) | |-+= 17740 root sshd: kucerjo3 [priv] (sshd) | | \-+- 02333 kucerjo3 sshd: kucerjo3@ttypb (sshd) | | \--= 27212 kucerjo3 -ksh (ksh) | \-+= 23050 root sshd: hans [priv] (sshd) | \-+- 25263 hans sshd: hans@ttyp1 (sshd) | \-+= 08229 hans -ksh (ksh) | \--= 21282 hans tmux: client (/tmp/tmux-1000/default) (tmux) |-+= 02726 root smtpd: [priv] (smtpd) | |--- 18443 _smtpq smtpd: queue (smtpd) | |--- 08025 _smtpd smtpd: klondike (smtpd) | |--- 31349 _smtpd smtpd: control (smtpd) | |--- 16695 _smtpd smtpd: lookup (smtpd) | |--- 14155 _smtpd smtpd: scheduler (smtpd) | \--- 21546 _smtpd smtpd: pony express (smtpd) |--= 04838 _sndio /usr/bin/sndiod |--= 22039 root /usr/sbin/cron |-+= 17826 root /usr/X11R6/bin/xdm | |-+= 12125 _x11 /usr/X11R6/bin/X :0 vt05 -auth /etc/X11/xdm/authdir/authfiles/A:0-w3skVf (Xorg) | | \--- 02357 root X: [priv] (Xorg) | \-+= 16455 root xdm: :0 (xdm) | \-+= 31648 hans /bin/sh /etc/X11/xdm/Xsession | \-+- 08036 hans /bin/sh /home/hans/.xsession | \-+- 18841 hans cwm | |-+= 25029 hans xterm | | \-+= 08806 hans /usr/X11R6/bin/luit -encoding ISO8859-2 -argv0 -ksh | | \-+= 09794 hans -ksh (ksh) | | \--= 02689 hans tmux: client (/tmp/tmux-1000/default) (tmux) | \-+= 19533 hans xterm | \-+= 10259 hans /usr/X11R6/bin/luit -encoding ISO8859-2 -argv0 -ksh | \-+= 00498 hans -ksh (ksh) | \--= 18534 hans ssh bbb |--- 00927 root xconsole |--- 08884 _x11 xconsole |-+= 30438 hans tmux: server (/tmp/tmux-1000/default) (tmux) | |-+= 25723 hans -ksh (ksh) | | \-+= 18540 root -ksh (ksh) | | \--= 16088 voipcall -ksh (ksh) | |-+= 23034 hans -ksh (ksh) | | \--= 06572 hans psql -U voipcall voipcall | |--= 00436 hans -ksh (ksh) | |-+= 01329 hans -ksh (ksh) | | \-+= 31382 hans script pstree.script | | \-+- 20579 hans script pstree.script | | \-+= 31856 hans /bin/ksh -i | | \-+= 02741 hans pstree | | \-+- 08780 hans sh -c ps -kaxwwo user,pid,ppid,pgid,command | | \--- 06339 hans ps -kaxwwo user | \-+= 14981 hans -ksh (ksh) | \-+= 15381 root -ksh (ksh) | \--= 12701 voipcall -ksh (ksh) |--= 28128 hans ssh-agent -s |-+- 13080 _postgresql /usr/local/bin/postgres -D /var/postgresql/data | |--= 00621 _postgresql postgres: stats collector process (postgres) | |--= 28775 _postgresql postgres: checkpointer process (postgres) | |--= 15835 _postgresql postgres: writer process (postgres) | |--= 12421 _postgresql postgres: wal writer process (postgres) | |--= 29923 _postgresql postgres: autovacuum launcher process (postgres) | \--= 14424 _postgresql postgres: voipcall voipcall [local] idle (postgres) |--= 07462 root /usr/libexec/getty std.9600 ttyC0 |--= 06767 root /usr/libexec/getty std.9600 ttyC1 |--= 31889 root /usr/libexec/getty std.9600 ttyC2 |--= 24080 root /usr/libexec/getty std.9600 ttyC3 \--= 26697 root /usr/libexec/getty std.9600 ttyC5 hans@ppc:~$ hans@ppc:~$ pste hans@ppc:~$ pstree | cat hans@ppc:~$ hans@ppc:~$ pstree | tee hans@ppc:~$ hans@ppc:~$ pstree > ps hans@ppc:~$ hans@ppc:~$ ls -l ps -rw-r--r-- 1 hans hans 75 May 10 18:49 ps hans@ppc:~$ hans@ppc:~$ pstree | hexdump 0000000 0a0a 0a0a 0a0a 0a0a 0a0a 0a0a 0a0a 0a0a * 0000040 0a0a 0a0a 0a0a 0a0a 0a0a 0a0a 000004c hans@ppc:~$ hans@ppc:~$ ^D Script done on Sun May 10 18:50:04 2015