Deleting "user input line number" from a file using sed

Hi

I want to delete a line from a txt file for which the line number is user input. Say when user selects 19, the 19th line would be deleted from the file. Can anyone please provide me with a sed one liner for the same... I tried sed -i. The interaction would be like this

Enter the line to be deleted: 19

Record deleted from file.

I am facing problem in fixing user inpuit in a variable to sed -i

Thanks,
Sudeep

sed "$linenumber"d infile > outfile

Thanks shailesh

But the problem is that the file is very huge and xtra space consumption for a temp file is to be avoided even for creating any sort of swap in real time. Can it be done without making a temporary file

Regards,
Sudeep

What does your code look like?

Also, what sed are you using?

I know this is a late response but I believe this will work:

sed -i /"$1"/d filename