BASH nl command - start at 0?

Discussion in 'Mac Programming' started by Big Dave, Feb 18, 2010.

  1. Big Dave macrumors 6502

    Joined:
    Nov 27, 2007
    Location:
    Crestview, Fl
    #1
    I'm using nl to number the lines in a file:

    nl file > newfile

    nl defaults to labeling the first line 1.

    Is there a way to make nl start at 0?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Use the manual! Type:

    Code:
    man nl
    
    and see what it says (hint look for -v switch)
     
  3. Big Dave thread starter macrumors 6502

    Joined:
    Nov 27, 2007
    Location:
    Crestview, Fl
    #3
    Thanks for the help! Worked great. I didn't know if -v was the right choice. I should have tried it. DOH! Thanks!
     

Share This Page