This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: svn diff branch woprking copy against mainline?


> 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@(/[^/]*)/[^/]+$@$1@;
}

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]