Synopsis:      "cut -f 2,1" doesn't switch fields 1 and 2.
Category:       Serious bug in base system.
Environment:
        System      : OpenBSD 5.4
        Details     : OpenBSD 5.4 (GENERIC.MP) #41: Tue Jul 30 15:30:02 MDT 2013
                         
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP

        Architecture: OpenBSD.amd64
        Machine     : amd64
Description:

The following command

  $ echo a,b | cut -d , -f 2,1
prints

  a,b

instead of

  b,a

as the manual page of cut(1) tells.

How-To-Repeat:

Script started on Thu Jul 10 09:27:36 2014
$ cat foo
a,b
$ cut -d , -f 2,1 foo
a,b
$ ^D

Script done on Thu Jul 10 09:28:07 2014

Fix:

I don't have a fix.

dmesg:
OpenBSD 5.4 (GENERIC.MP) #41: Tue Jul 30 15:30:02 MDT 2013
    [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8304394240 (7919MB)
avail mem = 8075603968 (7701MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.6 @ 0x9f800 (50 entries)
bios0: vendor American Megatrends Inc. version "080015" date 05/29/2013
bios0: BIOSTAR Group A960D+
acpi0 at bios0: rev 0
acpi0: sleep states S0 S1 S4 S5
acpi0: tables DSDT FACP APIC MCFG OEMB HPET SSDT
acpi0: wakeup devices PCE2(S4) PCE3(S4) PCE4(S4) PCE5(S4) PCE6(S4) PCE7(S4) 
PCE9(S4) PCEA(S4) PCEB(S4) PCEC(S4) SBAZ(S4) PSKE(S4) PSMS(S4) ECIR(S4) 
PS2K(S1) PS2M(S1) [...]
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: AMD Phenom(tm) II X4 945 Processor, 3000.57 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,NODEID,ITSC
cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 
16-way L2 cache, 6MB 64b/line 48-way L3 cache
cpu0: ITLB 32 4KB entries fully associative, 16 4MB entries fully associative
cpu0: DTLB 48 4KB entries fully associative, 48 4MB entries fully associative
cpu0: AMD erratum 721 detected and fixed
cpu0: smt 0, core 0, package 0
cpu0: apic clock running at 200MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: AMD Phenom(tm) II X4 945 Processor, 3000.18 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,NODEID,ITSC
cpu1: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 
16-way L2 cache, 6MB 64b/line 48-way L3 cache
cpu1: ITLB 32 4KB entries fully associative, 16 4MB entries fully associative
cpu1: DTLB 48 4KB entries fully associative, 48 4MB entries fully associative
cpu1: AMD erratum 721 detected and fixed
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 2 (application processor)
cpu2: AMD Phenom(tm) II X4 945 Processor, 3000.18 MHz
cpu2: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,NODEID,ITSC
cpu2: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 
16-way L2 cache, 6MB 64b/line 48-way L3 cache
cpu2: ITLB 32 4KB entries fully associative, 16 4MB entries fully associative
cpu2: DTLB 48 4KB entries fully associative, 48 4MB entries fully associative
cpu2: AMD erratum 721 detected and fixed
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 3 (application processor)
cpu3: AMD Phenom(tm) II X4 945 Processor, 3000.18 MHz
cpu3: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,NODEID,ITSC
cpu3: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 
16-way L2 cache, 6MB 64b/line 48-way L3 cache
cpu3: ITLB 32 4KB entries fully associative, 16 4MB entries fully associative
cpu3: DTLB 48 4KB entries fully associative, 48 4MB entries fully associative
cpu3: AMD erratum 721 detected and fixed
cpu3: smt 0, core 3, package 0
ioapic0 at mainbus0: apid 4 pa 0xfec00000, version 21, 24 pins
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
acpihpet0 at acpi0: 14318180 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (P0P1)
acpiprt2 at acpi0: bus -1 (PCE2)
acpiprt3 at acpi0: bus -1 (PCE3)
acpiprt4 at acpi0: bus 2 (PCE7)
acpiprt5 at acpi0: bus 3 (P0PC)
acpicpu0 at acpi0: PSS
acpicpu1 at acpi0: PSS
acpicpu2 at acpi0: PSS
acpicpu3 at acpi0: PSS
acpitz0 at acpi0: critical temperature is 127 degC
acpibtn0 at acpi0: PWRB
cpu0: 3000 MHz: speeds: 3000 2300 1800 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "AMD RS780 Host" rev 0x00
ppb0 at pci0 dev 1 function 0 "AMD RS780 PCIE" rev 0x00
pci1 at ppb0 bus 1
vga1 at pci1 dev 5 function 0 "ATI Radeon HD 3000" rev 0x00
radeondrm0 at vga1: apic 4 int 18
drm0 at radeondrm0
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
ppb1 at pci0 dev 7 function 0 "AMD RS780 PCIE" rev 0x00: msi
pci2 at ppb1 bus 2
re0 at pci2 dev 0 function 0 "Realtek 8168" rev 0x07: RTL8168E/8111E-VL 
(0x2c80), apic 4 int 19, address b8:97:5a:47:68:54
rgephy0 at re0 phy 7: RTL8169S/8110S PHY, rev. 5
ahci0 at pci0 dev 17 function 0 "ATI SBx00 SATA" rev 0x00: apic 4 int 22, AHCI 
1.1
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 2 lun 0: <ATA, Hitachi HTS54756, JEDO> SCSI3 0/direct 
fixed naa.5000cca6dfc8fa6e
sd0: 610480MB, 512 bytes/sector, 1250263728 sectors
cd0 at scsibus0 targ 3 lun 0: <ATAPI, iHAS124 W, HL02> ATAPI 5/cdrom removable
ohci0 at pci0 dev 18 function 0 "ATI SB700 USB" rev 0x00: apic 4 int 16, 
version 1.0, legacy support
ohci1 at pci0 dev 18 function 1 "ATI SB700 USB" rev 0x00: apic 4 int 16, 
version 1.0, legacy support
ehci0 at pci0 dev 18 function 2 "ATI SB700 USB2" rev 0x00: apic 4 int 17
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "ATI EHCI root hub" rev 2.00/1.00 addr 1
ohci2 at pci0 dev 19 function 0 "ATI SB700 USB" rev 0x00: apic 4 int 18, 
version 1.0, legacy support
ohci3 at pci0 dev 19 function 1 "ATI SB700 USB" rev 0x00: apic 4 int 18, 
version 1.0, legacy support
ehci1 at pci0 dev 19 function 2 "ATI SB700 USB2" rev 0x00: apic 4 int 19
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "ATI EHCI root hub" rev 2.00/1.00 addr 1
piixpm0 at pci0 dev 20 function 0 "ATI SBx00 SMBus" rev 0x3c: SMI
iic0 at piixpm0
"eeprom" at iic0 addr 0x50 not configured
"eeprom" at iic0 addr 0x51 not configured
pciide0 at pci0 dev 20 function 1 "ATI SB700 IDE" rev 0x00: DMA, channel 0 
configured to compatibility, channel 1 configured to compatibility
azalia0 at pci0 dev 20 function 2 "ATI SBx00 HD Audio" rev 0x00: apic 4 int 16
azalia0: codecs: Realtek ALC662
audio0 at azalia0
pcib0 at pci0 dev 20 function 3 "ATI SB700 ISA" rev 0x00
ppb2 at pci0 dev 20 function 4 "ATI SB600 PCI" rev 0x00
pci3 at ppb2 bus 3
ohci4 at pci0 dev 20 function 5 "ATI SB700 USB" rev 0x00: apic 4 int 18, 
version 1.0, legacy support
pchb1 at pci0 dev 24 function 0 "AMD AMD64 10h HyperTransport" rev 0x00
pchb2 at pci0 dev 24 function 1 "AMD AMD64 10h Address Map" rev 0x00
pchb3 at pci0 dev 24 function 2 "AMD AMD64 10h DRAM Cfg" rev 0x00
km0 at pci0 dev 24 function 3 "AMD AMD64 10h Misc Cfg" rev 0x00
pchb4 at pci0 dev 24 function 4 "AMD AMD64 10h Link Cfg" rev 0x00
usb2 at ohci0: USB revision 1.0
uhub2 at usb2 "ATI OHCI root hub" rev 1.00/1.00 addr 1
usb3 at ohci1: USB revision 1.0
uhub3 at usb3 "ATI OHCI root hub" rev 1.00/1.00 addr 1
usb4 at ohci2: USB revision 1.0
uhub4 at usb4 "ATI OHCI root hub" rev 1.00/1.00 addr 1
usb5 at ohci3: USB revision 1.0
uhub5 at usb5 "ATI OHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
it0 at isa0 port 0x2e/2: IT8728F rev 0, EC port 0xe80
usb6 at ohci4: USB revision 1.0
uhub6 at usb6 "ATI OHCI root hub" rev 1.00/1.00 addr 1
mtrr: Pentium Pro MTRR support
urtwn0 at uhub0 port 2 "Realtek 802.11n WLAN Adapter" rev 2.00/2.00 addr 2
urtwn0: MAC/BB RTL8188CUS, RF 6052 1T1R, address 00:e0:4b:a6:35:cc
umass0 at uhub0 port 5 configuration 1 interface 0 "Generic Mass Storage 
Device" rev 2.00/1.00 addr 3
umass0: using SCSI over Bulk-Only
scsibus1 at umass0: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0: <Multi, Flash Reader, 1.00> SCSI0 0/direct 
removable serial.058f6366058F63666471
uhidev0 at uhub2 port 3 configuration 1 interface 0 "Logitech USB Keyboard" rev 
1.10/64.00 addr 2
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
uhidev1 at uhub2 port 3 configuration 1 interface 1 "Logitech USB Keyboard" rev 
1.10/64.00 addr 2
uhidev1: iclass 3/0, 3 report ids
uhid0 at uhidev1 reportid 1: input=1, output=0, feature=0
uhid1 at uhidev1 reportid 2: input=1, output=0, feature=0
uhid2 at uhidev1 reportid 3: input=3, output=0, feature=0
uhidev2 at uhub3 port 1 configuration 1 interface 0 "Logitech USB Optical 
Mouse" rev 2.00/63.00 addr 2
uhidev2: iclass 3/1
ums0 at uhidev2: 3 buttons, Z dir
wsmouse0 at ums0 mux 0
uhidev3 at uhub5 port 1 configuration 1 interface 0 "vendor 0x1d57 2.4G 
Receiver" rev 1.10/1.10 addr 2
uhidev3: iclass 3/1
ukbd1 at uhidev3: 8 variable keys, 6 key codes, country code 33
wskbd2 at ukbd1 mux 1
wskbd2: connecting to wsdisplay0
uhidev4 at uhub5 port 1 configuration 1 interface 1 "vendor 0x1d57 2.4G 
Receiver" rev 1.10/1.10 addr 2
uhidev4: iclass 3/1
ums1 at uhidev4: 5 buttons, Z dir
wsmouse1 at ums1 mux 0
uhidev5 at uhub5 port 1 configuration 1 interface 2 "vendor 0x1d57 2.4G 
Receiver" rev 1.10/1.10 addr 2
uhidev5: iclass 3/0, 3 report ids
uhid3 at uhidev5 reportid 1: input=1, output=0, feature=7
uhid4 at uhidev5 reportid 3: input=2, output=0, feature=0
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on sd0a (34a43edcb0d35fe8.a) swap on sd0b dump on sd0b

usbdevs:
Controller /dev/usb0:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), ATI(0x1002), 
rev 1.00
 port 1 powered
 port 2 addr 2: high speed, power 500 mA, config 1, 802.11n WLAN 
Adapter(0x8176), Realtek(0x0bda), rev 2.00, iSerialNumber 00e04c000001
 port 3 powered
 port 4 powered
 port 5 addr 3: high speed, power 100 mA, config 1, Mass Storage 
Device(0x6366), Generic(0x058f), rev 1.00, iSerialNumber 058F63666471
 port 6 powered
Controller /dev/usb1:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), ATI(0x1002), 
rev 1.00
 port 1 powered
 port 2 powered
 port 3 powered
 port 4 powered
 port 5 powered
 port 6 powered
Controller /dev/usb2:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), ATI(0x1002), 
rev 1.00
 port 1 powered
 port 2 powered
 port 3 addr 2: low speed, power 90 mA, config 1, USB Keyboard(0xc31c), 
Logitech(0x046d), rev 64.00
Controller /dev/usb3:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), ATI(0x1002), 
rev 1.00
 port 1 addr 2: low speed, power 100 mA, config 1, USB Optical Mouse(0xc05a), 
Logitech(0x046d), rev 63.00
 port 2 powered
 port 3 powered
Controller /dev/usb4:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), ATI(0x1002), 
rev 1.00
 port 1 powered
 port 2 powered
 port 3 powered
Controller /dev/usb5:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), ATI(0x1002), 
rev 1.00
 port 1 addr 2: low speed, power 100 mA, config 1, 2.4G Receiver(0x32da), 
vendor 0x1d57(0x1d57), rev 1.10
 port 2 powered
 port 3 powered
Controller /dev/usb6:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), ATI(0x1002), 
rev 1.00
 port 1 powered
 port 2 powered

Reply via email to