25 lines
471 B
Perl
Executable file
25 lines
471 B
Perl
Executable file
#!/usr/bin/perl
|
|
# Use with tags created with 'ctags -x'; give it a symbol
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
my $pat = $ARGV[0] or die("Need a tag to find");
|
|
print "Found for the tag $pat: \n";
|
|
|
|
sub main
|
|
{
|
|
my $t = 'tags';
|
|
open(FH, $t) or die("File $t not found.");
|
|
|
|
while (my $line = <FH>) {
|
|
if ($line =~ /^$pat/) {
|
|
my @l = split(' ', $line);
|
|
#print "$l[3]:$l[2] \n";
|
|
exec 'echo $l[3]:$l[2] > /dev/null'
|
|
}
|
|
}
|
|
}
|
|
|
|
main();
|