SVN: geninitrd/trunk/geninitrd

Przemyslaw Iskra sparky at pld-linux.org
Sat Jan 27 18:35:39 CET 2007


On Sat, Jan 27, 2007 at 05:56:35PM +0100, czarny wrote:

> Modified: geninitrd/trunk/geninitrd
> ==============================================================================
> --- geninitrd/trunk/geninitrd	(original)
> +++ geninitrd/trunk/geninitrd	Sat Jan 27 17:56:34 2007
> @@ -1517,12 +1517,14 @@
>      return txt \
>  } \
>  BEGIN { \
> -    num_pattern = "[0-9][0-9][0-9][0-9]"; \
> +    num_pattern_short = "[0-9][0-9][0-9]" \
semicolon is missing

> +    num_pattern = num_pattern_short "[0-9]"; \
>      dev_pattern = "[hms][a-z][a-z]([0-9])+"; \
>      partition = "Metallica rocks!"; \
>      min = -1; maj = -1; \
>  } \
> -$0 ~ prefix "0x" num_pattern { sub(/root=0x/,"root="); } \
> +$0 ~ prefix "0x" num_pattern { sub(prefix "0x", prefix); } \
> +$0 ~ prefix num_pattern_short { sub(prefix, prefix 0); } \
>  $0 ~ prefix num_pattern { \
>      gsub(/.*root=/,NIL,partition); \
>      gsub(/ .*/,NIL,partition); \

anyway, this is wrong, theck this one:

echo root=0303 | awk 'BEGIN { prefix="root="; num_pattern_short =
	"[0-9][0-9][0-9]"; num_pattern = num_pattern_short "[0-9]"; } $0 ~
	prefix num_pattern_short { sub(prefix, prefix 0); } { print }'

returns:

root=00303

there should be '$' or something

-- 
 ____  Sparky{PI] -- Przemyslaw _  ___  _  _  ........... LANG...Pl..Ca..Es..En
/____) ___  ___  _ _ || Iskra  |  | _ \| |  | : WWW........ppcrcd.pld-linux.org
\____\| -_)'___| ||^'||//\\// <   |  _/| |  | : JID......sparky<at>jabberes.org
(____/||   (_-_|_||  ||\\ ||   |_ |_|  |_| _| : Mail....sparky<at>pld-linux.org


More information about the pld-devel-en mailing list