Can't get "grep -F" to work like real grep
Paul Gover
pmw.gover at yahoo.co.uk
Mon Dec 9 14:59:05 UTC 2019
I hope I'm doing something mindnumbingly stupid; grep -F output is not as expected.
Please can anyone spot the problem? Thanks.
(Background: I'm writing a script to manage kernel images in /boot, and want to prevent
the user deleting the kernel currently being executed.)
This is sys-apps/busybox-1.30.1 on Gentoo,
compared with sys-apps/busybox-1.30.1
all running on an amd64 box.
Running in /boot, where:
*acer /boot #* ls vmlinuz-*
*acer /boot #* uname -v
Linux grep produces:
*acer /boot #* grep -Fl "#6 SMP Sun Sep 29 00:17:32 BST 2019" vmlinuz-*
vmlinuz-5.1.16-gentoorx570
whereas busybox grep produces no matches. Removing the -F fixes it:
*acer /boot #* busybox grep -l "#6 SMP Sun Sep 29 00:17:32 BST 2019" vmlinuz-*
I tried:
*acer /boot #* uname -v > ver
*acer /boot #* busybox grep -Flf ver vmlinuz-*
Still no output, but:
*acer /boot #* busybox grep -lf ver vmlinuz-*
(I know "file vmlinuz" can pull the necessary info, but "file" isn't in busybox. I'll listen to
alternatives.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20191209/5bfd5622/attachment.html>
More information about the busybox
mailing list