[lkml]   [2009]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] kconfig: simplification of scripts/extract-ikconfig
On Wed, Jun 24, 2009 at 03:31:48PM +0200, Dick Streefland wrote:
>On Wednesday 2009-06-24 13:46, Dick Streefland wrote:
>| Because I don't want to rely on a particular version of grep, I've
>| modified the script to use perl instead. I hope that's OK. Below is
>| a new patch.

Sorry for the delay, I missed this patch...

>I found a way to work around the differences in behavior of grep.
>Older versions of grep report the byte offset of the start of the
>line instead of the byte offset of the pattern. By using tr to
>make sure the pattern is always at the start of a "line", both old
>and new versions of grep can be used.

This is very tricky...


> {
>- echo " usage: extract-ikconfig [b]zImage_filename"
>- if [ "$TMPFILE" != "" ]; then
>- rm -f $TMPFILE
>+ if pos=`tr "$cf1\n$cf2" "\n$cf2=" < "$1" | grep -abo "^$cf2"`

Does this work?
My quick test shows no...

I still can't get the right offset number with this trick.

P.S. My grep is 2.5.1.

 \ /
  Last update: 2009-06-29 04:53    [W:0.070 / U:3.684 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site