Diferencia entre revisiones de «Shell de Unix»

De Wikipedia, la enciclopedia libre
Contenido eliminado Contenido añadido
Manuelt15 (discusión · contribs.)
m Revertidos los cambios de 132.248.90.243 a la última edición de ColdWind
Línea 20: Línea 20:


== Otros tipos de shells ==
== Otros tipos de shells ==
The pUnix shell was unusual when it was first created. Since it is both an interactive [[Shell (computing)|command language]] and the language used to [[Shell script|script]] the system, it is a [[scripting programming language]]. Many shells created for other [[operating system]]s offer rough equivalents to Unix shell functionality.
The Unix shell was unusual when it was first created. Since it is both an interactive [[Shell (computing)|command language]] and the language used to [[Shell script|script]] the system, it is a [[scripting programming language]]. Many shells created for other [[operating system]]s offer rough equivalents to Unix shell functionality.


On systems using a [[windowing system]], some users may never use the shell directly. On Unix systems, the shell is still the implementation language of system startup scripts, including the program that starts the windowing system, the programs that facilitate access to the [[Internet]], and many other essential functions.
On systems using a [[windowing system]], some users may never use the shell directly. On Unix systems, the shell is still the implementation language of system startup scripts, including the program that starts the windowing system, the programs that facilitate access to the [[Internet]], and many other essential functions.

Revisión del 17:43 2 sep 2009


Pantalla durante una sesión muestra Bash, tomada en Gentoo Linux.

Un shell de Unix es una shell de línea de comando que ofrece la interfaz del usuario tradicional para el sistema operativo Unix y para sistemas similares a Unix. Los usuarios controlan el funcionamiento de la computadora introduciendo la instrucción en forma de texto, a fin de que un intérprete de líneas de comandos lo ejecute. También se suele referir a shell como lenguaje de programación, llamando a los ficheros ejecutables shell-scripts.

En el sentido más genérico del término shell significa cualquier programa que los usuarios usen para tipear comandos. Dado que en los sistemas operativos Unix los usuarios pueden seleccionar cuál shell quieren usar (programa que se debería ejecutar cuando se logean), se han desarrollado muchos shell. Se lo llama "shell" porque oculta los detalles del sistema operativo subyacente detrás de la interfaz del shell (en contraste con el núcleo o kernel, el cual se refiere a los componentes de nivel más bajo del sistema operativo). Similar a las interfaces de usuario gráficas para Unix, como son GNOME, KDE y Xfce pueden ser llamadas shells visuales o shells gráficas. Por sí mismo, el término shell es asociado usualmente con la linea de comando. En Unix, cualquier programa puede ser un shell de usuario. Los usuarios que desean utilizar una sintaxis diferente para redactar comandos pueden especificar un programa diferente como su shell.

El término shell también hace referencia a un programa particular, tal como el Bourne shell, sh. El Bourne shell fue el shell usado en las primeras versiones de Unix y se convirtió en un estándar de facto; todos los sistemas similares a Unix tienen al menos un shell compatible con el Bourne shell. El programa Bourne shell se encuentra dentro de la jerarquía de archivos de Unix en /bin/sh. En algunos sistemas, tal como BSD, /bin/sh es un Bourne shell o un equivalente, pero en otros sistemas como muchas distribuciones de Linux, /bin/sh es un enlace simbólico a un shell compatible con más características (como Bash). POSIX especifica su shell estándar como un subconjunto estricto del Korn shell.

Otros tipos de shells

The Unix shell was unusual when it was first created. Since it is both an interactive command language and the language used to script the system, it is a scripting programming language. Many shells created for other operating systems offer rough equivalents to Unix shell functionality.

On systems using a windowing system, some users may never use the shell directly. On Unix systems, the shell is still the implementation language of system startup scripts, including the program that starts the windowing system, the programs that facilitate access to the Internet, and many other essential functions.

On MS-DOS, OS/2, and Windows, equivalents to Unix system scripts are called batch files, and have either a ".bat" or ".cmd" extension. A newer CLI - Windows PowerShell, will replace the existing NT command line, cmd.exe; it has many features derived from Unix shells, though it uses a somewhat different syntax.

Many users of a Unix system still find a modern command line shell much more convenient for many tasks than any GUI application.

Due to the recent movement in favor of open source, most Unix shells have at least one version that is open source.

Categorías de shell

Unix shells can be broadly divided into four categories: Bourne-like, C Shell-like, nontraditional, and historical.

Compatibles con Bourne shell

  • Bourne shell (sh) -- Escrita por Steve Bourne, cuando estaba en Bell Labs. First distributed with Version 7 Unix, circa 1978, and enhanced over the years.
    • Almquist shell (ash) -- Written as a BSD-licensed replacement for the Bourne Shell; often used in resource-constrained environments. The sh of FreeBSD, NetBSD (and their derivatives) are based on ash that has been enhanced to be POSIX conformant for the occasion.
    • Bourne-Again shell (bash) -- Written as part of the GNU project to provide a superset of Bourne Shell functionality.
    • Debian Almquist shell (dash) -- Dash is a modern replacement for ash in Debian.
    • Korn shell (ksh) -- Written by David Korn, while at Bell Labs.
    • Z shell (zsh) -- considered as the most complete (read: the most features) shell: it is the closest thing that exists to a superset of sh, ash, bash, csh, ksh, and tcsh.

C shell compatible

Otros o exóticos

Una lista de varios shells puede ser encontrada en: www.freebsd.org.

Archivos de configuración para shells

Un shell lee archivos de configuracion en multiples circunstancias bajo diferentes dependencias de la shell. Esta tabla muestra los achivos de configuracion de las shells mas populares:

sh ksh csh tcsh bash zsh
/etc/.login no no login login no no
/etc/csh.cshrc no no no yes no no
/etc/csh.login no no no login no no
~/.tcshrc no no no yes no no
~/.cshrc no no yes yes no no
~/.login no no login login no no
~/.logout no no login login no no
/etc/profile login login no no i.login no
~/.profile login login no no login no
~/.bash_profile no no no no login no
~/.bash_login no no no no login no
~/.bashrc no no no no n/login no
/etc/zshenv no no no no no yes
/etc/zprofile no no no no no login
/etc/zshrc no no no no no int.
/etc/zlogin no no no no no login
/etc/zlogout no no no no no login
~/.zshenv no no no no no yes
~/.zprofile no no no no no login
~/.zshrc no no no no no int.
~/.zlogin no no no no no login
~/.zlogout no no no no no login

Explicación:

  • "no" significa que un archivo is not read by a shell at all.
  • "yes" significa que un archivo es siempre leido por el shell.
  • "login" significa que un archivo is read if the shell is a login shell.
  • "n/login" significa que un archivo is read if the shell is not a login shell.
  • "int." significa que un archivo es leido si es un shell intercativo.
  • "i.login" significa que un archivo is read if the shell is an interactive login shell.

Historic

Non-Unix shells

Dentro del conjunto de sistemas operativos Microsoft Windows, el análogo son los programas command.com, o cmd.exe para sistemas operativos basados en Windows NT, y Windows PowerShell introducido con Windows Server 2008.

Further reading

  • Ellie Quigley (2001). «Introduction to UNIX shells». Unix Shells by Example. Prentice Hall PTR. ISBN 0-13-066538-X.  — a history of the various shells, and the uses of and responsibilities of a shell on Unix

Véase también

Enlaces externos