[PATCH v2] commands: add 'findstr' to search file for string
Christoph Fritz
chf.fritz at googlemail.com
Wed May 21 02:49:43 PDT 2014
Hi Antony
On Wed, 2014-05-21 at 13:22 +0400, Antony Pavlov wrote:
> On Wed, 21 May 2014 10:02:42 +0200
> Christoph Fritz <chf.fritz at googlemail.com> wrote:
>
> > Command 'findstr' can be for example used to find string
>
> We already have some commands with string.h style names:
> memcmp, memcpy, memset
>
> Can we use 'strstr' name for your new command?
Sure, anyone with any objections?
> Another proposition:
> can we add <offset from file start> and <no more N characters to
> search> parameters?
>
> Using these parameters you can speed up your search and use your
> command with /dev/mem.
Ok, I can add this to a [PATCH v3], anyone with any objections?
> > "MAC=1C:BA:8C:F3:82:BB" in file /dev/eeprom0 to set an
> > appropriate environment variable:
> >
> > $ findstr -o 16 -l 17 -t eth0.ethaddr pcm051_eth0_MAC= /dev/eeprom0
> >
> > Usage: findstr [OPTIONS] <STRING> <FILE>
> > Find ASCII string in file and print it
> > -o <offset> set offset of string which gets printed
> > -l <length> set length of string which gets printed
> > -t <var> print into variable instead of stdio
Thanks
-- Christoph
More information about the barebox
mailing list