Plan 9 from Bell Labs’s /usr/web/sources/contrib/anothy/bin/rc/looktag

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc

# Given a list of tags, plumb the corresponding file:line to edit.

if(test $#* -lt 1) {
	echo 'usage: '$0' tag [-f tagfile] [tag...]' >[1=2]
	exit usage
}

flagfmt='f tagfile'
eval `{aux/getflags $*}
if(~ $#flagf 0)
	flagf=tags
if(! test -r $flagf) {
	echo 'error: can''t read tag file ' $flagf >[1=2]
	exit readtags
}

for (i in $*) {
	plumb `{grep '^'$i $flagf | awk '{print $2}'}
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].