SHELLS(8)

NAME
shells - utility to programmatically edit the shells database

SYNOPSIS
shells [-K shells_file] add shell
shells [-K shells_file] check shell
shells [-K shells_file] list
shells [-K shells_file] remove shell

DESCRIPTION
shells is a utility that allows the system administrator to programmatically edit the shells(5) database. It is specially designed to be integrated into packaging systems to allow them to register and unregister shells from the shells file.

Whenever possible, the utility attempts to preserve existing comments in the file. The utility does not validate the syntax of existing files; it assumes they are valid.

The following options are available:

-K shells_file
    Path to the shells(5) database to access. Defaults to /etc/shells if not specified.

The following commands are available:

add shell
    Adds the shell to the shells file. shell must be an absolute path and the file pointed to by it must exist and be executable.

    If shell is already listed in the shells file, an error is raised.

    If the shells file does not exist, it is created.

check shell
    Verifies if shell is listed in the shells file.

list
    Lists all shells registered in the shells file.

remove shell
    Removes the shell from the shells file. shell must be an absolute path and it must be listed in the shells file.

    If shell is not listed in the shells file, an error is raised.

    If the shells file turns out to be completely empty after the removal of the shell, the file is removed. Note that if the file is left with comments in it but with no shells, it is not removed.

FILES
/etc/shells
    Default shells(5) file.

DIAGNOSTICS
The add, list and remove commands return 0 on success and any non-zero value on failure.

The check command returns 0 if the shell is found in the shells file and 1 otherwise.

SEE ALSO
shells(5)

AUTHORS
The shells command was developed by Julio Merino <jmmv@NetBSD.org>.