sed help please

I’m trying to run a script that patches the Linux kernel source, but it errors and dies midway through saying sed: invalid option – 1. My current guess is that this is referring to the following line in the script:

sed 1,"$CRAMFS"d fs/ >>Config.tmp

I don’t know sed, and the inclusion of a number and comma indeed doesn’t resemble what the man page shows for input parameters. Assuming this is some sort of deprecated calling syntax, does anyone know how I can rewrite it so the script will work?

Thank you

Nevermind… :o

The calling parameters for the script had changed from what was listed in the documentation. (I’m thinking the “1” is a macro for the first argument?) Anyhoo, apologies for the spam.

Haven’t done any SED since… well a long time, anyway.

Pretty sure that there should be a space between the “$CRAMFS” (which should be a numeric value, denoting up to which line to do the changes) and the <d> character (which means “delete the line”). Basicly (IIRC how SED syntax works), the script should delete the first $CRAMFS lines of fs/ and wrtie the result to Config.tmp.

You should most certainly back up all of the relevant files before trying any of my advice, however :eek:


Gah, simulpost!

So what was the command you ended up giving to SED? Inquisitive minds want to know!

No idea. It was just a line in the shell script.

I saw the place in the shell script where it (was supposed to but did not) show the usage parameters, so rerunning with proper parameters for the script itself went. The one I was using had, apparently, been deprecated. (Running it without parameters should ahve shown the usage, but instead popped open the file itself in a text editor! :confused: Gotta love computers. :smiley: )