grep pattern interpretted differently in 2 different systems with same grep version
Posted
by
Lance Woodson
on Server Fault
See other posts from Server Fault
or by Lance Woodson
Published on 2012-09-25T14:11:42Z
Indexed on
2012/09/25
15:39 UTC
Read the original article
Hit count: 478
We manufacture a linux appliance for data centers, and all are running fedora installed from the same kickstart process. There are different hardware versions, some with IDE hard drives and some SCSI, so the filesystems may be at /dev/sdaN or /dev/hdaN.
We have a web interface into these appliances that show disk usage, which is generated using "df | grep /dev/*da". This generally works for both hardware versions, giving an output like follows:
/dev/sda2 5952284 3507816 2137228 63% /
/dev/sda5 67670876 9128796 55049152 15% /data
/dev/sda1 101086 11976 83891 13% /boot
However, for one machine, we get the following result from that command:
Binary file /dev/sda matches
It seems that its grepping files matching /dev/*da for an unknown pattern for some reason, only on this box that is seemingly identical in grep version, packages, kernel, and hardware. I switched the grep pattern to be "/dev/.da" and everything works as expected on this troublesome box, but I hate not knowing why this is happening. Anyone have any ideas? Or perhaps some other tests to try?
© Server Fault or respective owner