GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  UNIX::ALIASFILE (3)

.ds Aq ’

NAME

Unix::AliasFile - Perl interface to /etc/aliases format files

CONTENTS

SYNOPSIS



  use Unix::AliasFile;

  $al = new Unix::AliasFile "/etc/aliases";
  $al->alias("bozos", @members);
  $al->delete("deadlist");
  $al->remove_user("coolmail", "bgates", "badguy");
  $al->add_user("coolmail", "joecool", "goodguy");
  $al->remove_user("*", "deadguy");
  $al->commit();
  undef $al;



DESCRIPTION

The Unix::AliasFile module provides an abstract interface to Unix alias files. It automatically handles file locking, getting colons and commas in the right places, and all the other niggling details.

Unlike some of the other Unix::*File modules, this module will preserve the order of your alias file, with a few exceptions. Comments and aliases will appear in the file in the same order that they started in, unless you have comment lines interspersed between the beginning of an alias and continuation lines for that same alias. In this case, those comments will appear after the alias that contains them.

METHODS

add_user( ALIAS, CW@USERS )

This method will add the list of users to an existing alias. Users that are already members of the alias are silently ignored. The special alias name * will add the users to every alias. Returns 1 on success or 0 on failure.

    alias( ALIAS [,@USERS] )

This method can add, modify, or return information about an alias. Supplied with a single alias parameter, it will return a list consisting of the members of that alias, or undef if no such alias exists. If you supply more parameters, the named alias will be created or modified if it already exists. The member list is also returned to you in this case.

    aliases( )

This method returns a list of all existing aliases. The list will be sorted in alphabetical order. In scalar context, this method returns the total number of aliases.

    comment( ALIAS, COMMENT )

This method inserts a comment line before the specified alias. You must supply your own comment marker (#) but a newline will be automatically appended to the comment unless it already has one. Returns 1 on success and 0 on failure.

    commit( [BACKUPEXT] )

See the Unix::ConfigFile documentation for a description of this method.

    delempty( )

This method will delete all existing aliases that have no members. It returns a count of how many aliases were deleted.

    delete( ALIAS )

This method will delete the named alias. It has no effect if the supplied alias does not exist.

    new( FILENAME [,OPTIONS] )

See the Unix::ConfigFile documentation for a description of this method.

remove_user( ALIAS, CW@USERS )

This method will remove the list of users from an existing alias. Users that are not members of the alias are silently ignored. The special alias name * will remove the users from every alias. Returns 1 on success or 0 on failure.

    rename_user( OLDNAME, NEWNAME )

This method will change one username to another in every alias. Returns the number of aliases affected.

    uncomment( COMMENT )

Remove the comment from the file that matches the supplied text. The match must be exact. Returns 1 on success and 0 on failure.

BUGS

While the Unix::AliasFile module will work with Perl versions prior to 5.005, it may exhibit a minor bug under those versions. The bug will cause program aliases with embedded comma characters to be broken apart. This will not happen under 5.005 and up, due to the use of the Text::ParseWords module, which changed significantly with the 5.005 release.

AUTHOR

Steve Snodgrass, ssnodgra@fore.com

SEE ALSO

Unix::AutomountFile, Unix::ConfigFile, Unix::GroupFile, Unix::PasswdFile
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 ALIASFILE (3) 2000-05-02

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.