Inspired by this junk from a introductory computer science elective "course":
...which makes me cringe on many, many levels.
This script takes a file from stdin and adds a comment after it with the number of the respective line. The commend delimiter is supplied as an argument.
Make sure you chmod +x
the file before executing. Execute with ./linolenum
.
It will automatically be executed by node because of the shebang, and for the
same reason node linolenum
will not work.