nl xsbackup.shThe output would look like this: 1 #
2 #!/bin/bash 3 # 4 # Script Name:Or at least, that’s how I used to do it. For decades I never noticed that cat had a -b option. So if you’d like to use cat to see line numbers in your script, just run the command, along with a -b.
cat -b xsbackup.shCat also allows output lines (-b skips lines with whitespace). Cat also has a squeeze option for sequential lines. Overall, not absolutely everything in nl, but enough that I doubt I’ll need to use nl much in the future.
krypted January 20th, 2014