Best way to number the lines with SHELL

Have a file:

,'A B', ss,10,
,'C D', tt, 20,
,'ST WW',aa,21,

want to put number in a line given initial number = 101. The expected output is
101,'A B', ss,10,
102,'C D', tt, 20,
103,'ST WW',aa,21,
I can loop each line to add the number. Can any gurus offer a better/concise way to achieve that?
Thanks in advance.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


nl -v 101 -s "" -n ln -w 3 inputfile > outputfile

Test without "> outputfile" to see the output on your terminal.

"nl" cannot change a file "in place". You must write the result to a new file, then rename this new file to the original filename, if desired.

"man nl" for more options.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jl66ConsultantAuthor Commented:
Thanks a lot. It works.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.