> I put it in a file called "checker" and, when I need it, ./checker

What I usually do is create a script called ".go" somewhere above it,
and I have a ~/bin/go that locates it and runs it.

I use this all over the place, so I'm used to just typing "go" or "go
<arg>" to DTRT.



#!/usr/bin/perl
# -*- perl -*-

$me = `pwd`;
$me =~ s/[\r\n]+$//;
$ENV{'GOPWD'} = $me;

while ($me =~ m@/[^/]*/[^/]+$@ && ! -f "$me/.go") {
    $me =~ s@(/[^/]*)/[^/[EMAIL PROTECTED]@;
}

chdir ($me) or die "chdir: $!";
if ( ! -f "./.go") {
    print STDERR "no .go to go to!\n";
    exit(1);
}
exec ("./.go", @ARGV) or die "exec: $!";

Reply via email to