ftp.nice.ch/pub/next/unix/developer/pcn.2.0.s.tar.gz#/scripts/host-control/alias.pl

This is alias.pl in view mode; [Download] [Up]

%aliases = ();

sub return_alias
{
    local($word) = @_;
    $aliases{$word};
}

sub expand_alias
{
    local($word) = @_;
    local($expand) = $aliases{$word};

    $expand ? $expand : $word;
}

sub add_alias
{
    local($word, $alias) = @_;

    $aliases{$word} = $alias;
}

sub remove_alias
{
    local($word) = @_;

    if ($aliases{$word})
    {
	delete $aliases{$word};
    }
    else
    {
	print "$word not aliased\n";
    }
}

sub write_aliases
{
    local($word, $alias);

    while (($word, $alias) = each %aliases)
    {
	print "$word $alias\n";
    }
}
	
1;

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.