Add line numbers to end of each line

Hi i would like to add line numbers to end of each line in a file.
I am able to do it in the front of each line using sed, but not able to add at the end of the file.

Can anyone suggest

The following code adds line number to start of each line
sed = filename | sed 'N;s/\n/\t/'

how can i do it at end of each line?

Thanks

nawk '{print $0, FNR}' myFile

If you are using two sed scripts anyway, it's not very hard.

sed = filename | sed -e 's/^\([1-9][0-9]*\)  *\(.*\)/\2 \1/'

My version of sed puts the line number on a separate line with the = command, not on the same line, so this script doesn't actually work for me. This might be easier and more efficient with a simple awk or perl script, anyway;

awk '{ print $0, NR }' filename
perl -lne 'print $_, " ", $.' filename

There is a number of reasons why line numbers are traditionally printed at the beginning rather than the end of lines, though. Perhaps it would be wiser to stick to the traditional format.

nawk is not available for me
here is what i get
-bash: nawk: command not found

try either awk or gawk

Works fine.
thanks