sed script - print the line number along with the line

Hi,
I want to print the line number with the pattern of the line on a same line using multi-patterns in sed.
But i don't know how to do it.
For example, I have a file

abc
def
ghi

I want to print

1 abc
2 def
3 ghi

I know how to write it one line code, but i don't know how to put it in sed script
Does anyone know how to do it?
Thanks

Try:

cat -n infile

Hi,
I mean how to use sed and put it in the sed script

sed = infile | sed 'N;s/\n/ /'

Do you know how to put it in a sed script?
I already knew how to use pipeline

I do not know what you mean...

NAME
     sed - stream editor

SYNOPSIS
     /usr/bin/sed [-n] script [file...]

     /usr/bin/sed   [-n]    [-e script]...    [-f script_file]...
     [file...]

I mean for example:

sed -f print_line_number filename

I want to write a sed script file named print_line_number to do this task.

I think you guys misunderstand what utputp said,he means HOW to solve this problem by using sed.Sorry,I don't know.....

---------- Post updated at 08:43 AM ---------- Previous update was at 08:14 AM ----------

I got a idea:

sed -ne '=' -e 'p' infile | sed  'N;s/\n/ /' -

@homeboy. That is not a single script, see post #4
---
AFAIK = writes to stdout and not to pattern space. Therefore I think it would always require two sed invocations.

Oh....I misunderstand this.As the above code i shown,it needs a pipeline,so i haven't figure out a method to put them is a script.

Hi,
Thank you very much for all inputs.
@Scrutinizer: You are right! I think we need a pipeline.