head	1.1;
branch	1.1.1;
access;
symbols
	ISELECT_1_4_0:1.1.1.2
	ISELECT_1_3_1:1.1.1.2
	ISELECT_1_3_0:1.1.1.2
	ISELECT_1_2_0:1.1.1.2
	ISELECT_1_1_0:1.1.1.2
	ISELECT_1_0_4:1.1.1.1
	vendor:1.1.1;
locks; strict;
comment	@# @;


1.1
date	97.12.10.14.28.13;	author rse;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	97.12.10.14.28.13;	author rse;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	98.04.05.16.37.12;	author rse;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@#!/sw/bin/perl
##
##  GotoURL -- go to a particular URL
##  Copyright (c) 1997 Ralf S. Engelschall, All Rights Reserved. 
##

$url = $ARGV[0];

$tmpfile = "/tmp/tmp.gotourl.cf";

@@RC = ();
open(RC, "<$ENV{'HOME'}/.gotourlrc");
while (<RC>) {
    next if (m|^\s*#.*|);
    next if (m|^\s*$|);
    if (m|^(\S+)\s+(.+)$|) {
        push(@@RC, { PAT => $1, CMD => $2 });
    }
}
close(RC);

unlink($tmpfile);
open(FP, ">$tmpfile");
print FP "\n";
print FP "URL: $url\n";
print FP "\n";
print FP "Available clients for this URL type:\n";
print FP "\n";
foreach $rc (@@RC) {
    if ($url =~ m|$rc->{PAT}|) {
        $cmd = $rc->{CMD};
        $cmd =~ s|%U|$url|g;
        $txt = $rc->{CMD};
        $txt =~ s|%U|...|g;
        print FP sprintf("%s %%%%S:%s%%%%\n", $txt, $cmd);
    }
}
print FP <<'EOT';
_____________________________________________________

Help: <up>,<down> .......... browse client list
      <return>,<right> ..... select client
      q,<left> ............. quit
EOT
close(FP);
$client = `iselect -n 'GotoURL 1.0' -t 'Select Client...' -p6 <$tmpfile`;
unlink($tmpfile);
if ($client ne '') {
    system("$client");
}

##EOF##
@


1.1.1.1
log
@Import iSelect 1.0.4
@
text
@@


1.1.1.2
log
@Import iSelect 1.1.0
@
text
@d35 1
a35 1
        print FP sprintf("%s <S:%s>\n", $txt, $cmd);
@

