Getting line numbers and jump in to

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#16 Post by technosaurus »

FNR is basically the line number. The trick to printing all fields after $1 is to set $1 to "" and print $0 (or you can loop from 2 to NF). This technique is similar in bash/sh to using while read LINE; do set $LINE; shift; echo $@....
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply