Display Line numbers

Hi all experts,

I am getting error in my shell scripts and i want to find out which lines is in errors. How i can display the line numbers . Is it NU command? Please give me some suggestions.

sed = filename | sed 'N;s/\n/\t/'

or

sed = filename | sed 'N; s/^/     /; s/ *\(.\{6,\}\)\n/\1  /'

Thanks.

cat -n filename

I am not sure which shell you are using, I am assuming it is bash shell.

You can try the following to debug your script:

bash -v myscript

or :

bash -x myscript