HACK THE SYSTEM: Diferencias entre CSH KSH BASH | Tabla rapida para entender sus diferencias

RSS

 Seguime por RSS

4 ago 2013

Diferencias entre CSH KSH BASH | Tabla rapida para entender sus diferencias

Existen basicamente zsh, csh, ksh y bash, pero, cual y porque usar?.
Les dejo una tabla que encontré muy util por cierto y la fuente por si quieren expandir un poco mas el tema.

                                     sh   csh  ksh  bash tcsh zsh  rc   es
Job control                          N    Y    Y    Y    Y    Y    N    N
Aliases                              N    Y    Y    Y    Y    Y    N    N
Shell functions                      Y(1) N    Y    Y    N    Y    Y    Y
"Sensible" Input/Output redirection  Y    N    Y    Y    N    Y    Y    Y
Directory stack                      N    Y    Y    Y    Y    Y    F    F
Command history                      N    Y    Y    Y    Y    Y    L    L
Command line editing                 N    N    Y    Y    Y    Y    L    L
Vi Command line editing              N    N    Y    Y    Y(3) Y    L    L
Emacs Command line editing           N    N    Y    Y    Y    Y    L    L
Rebindable Command line editing      N    N    N    Y    Y    Y    L    L
User name look up                    N    Y    Y    Y    Y    Y    L    L
Login/Logout watching                N    N    N    N    Y    Y    F    F
Filename completion                  N    Y(1) Y    Y    Y    Y    L    L
Username completion                  N    Y(2) Y    Y    Y    Y    L    L
Hostname completion                  N    Y(2) Y    Y    Y    Y    L    L
History completion                   N    N    N    Y    Y    Y    L    L
Fully programmable Completion        N    N    N    N    Y    Y    N    N
Mh Mailbox completion                N    N    N    N(4) N(6) N(6) N    N
Co Processes                         N    N    Y    N    N    Y    N    N
Builtin artithmetic evaluation       N    Y    Y    Y    Y    Y    N    N
Can follow symbolic links invisibly  N    N    Y    Y    Y    Y    N    N
Periodic command execution           N    N    N    N    Y    Y    N    N
Custom Prompt (easily)               N    N    Y    Y    Y    Y    Y    Y
Sun Keyboard Hack                    N    N    N    N    N    Y    N    N
Spelling Correction                  N    N    N    N    Y    Y    N    N
Process Substitution                 N    N    N    Y(2) N    Y    Y    Y
Underlying Syntax                    sh   csh  sh   sh   csh  sh   rc   rc
Freely Available                     N    N    N(5) Y    Y    Y    Y    Y
Checks Mailbox                       N    Y    Y    Y    Y    Y    F    F
Tty Sanity Checking                  N    N    N    N    Y    Y    N    N
Can cope with large argument lists   Y    N    Y    Y    Y    Y    Y    Y
Has non-interactive startup file     N    Y    Y(7) Y(7) Y    Y    N    N
Has non-login startup file           N    Y    Y(7) Y    Y    Y    N    N
Can avoid user startup files         N    Y    N    Y    N    Y    Y    Y
Can specify startup file             N    N    Y    Y    N    N    N    N
Low level command redefinition       N    N    N    N    N    N    N    Y
Has anonymous functions              N    N    N    N    N    N    Y    Y
List Variables                       N    Y    Y    N    Y    Y    Y    Y
Full signal trap handling            Y    N    Y    Y    N    Y    Y    Y
File no clobber ability              N    Y    Y    Y    Y    Y    N    F
Local variables                      N    N    Y    Y    N    Y    Y    Y
Lexically scoped variables           N    N    N    N    N    N    N    Y
Exceptions                           N    N    N    N    N    N    N    Y

Key to the table above.

   Y      Feature can be done using this shell.
          
   N      Feature is not present in the shell.
          
   F      Feature can only be done by using the shells function
          mechanism.
          
   L      The readline library must be linked into the shell to enable
          this Feature.
 
Fuente 

1 comentario:

  1. Interesante tabla para comparar y escoger entre las diversidad de shells que nos ofrecen los sistemas tipo UNIX; creo que el usuario debe tener bastante claro si usará una shell de forma interactiva y otra para programar o una sola shell para ambas funciones, porque a veces se usa una shell para interactuar con el sistema y otra para programar (sintaxis).

    Recuerdo cierto artículo no que no recomendaba el uso de las shells tipo C para programar scripts, esto es, si querías que tus scripts fueran portables y se ejecutarán en la mayoría de los sitemas tipo UNIX o UNIX sin dificultad, ya que el estándar en casi todos estos sistemas son las shells estilo bourne, ahora para usar como shell interactiva ahí si está a gusto de cada quien, pero es un hecho que una gran parte de los usuarios dejan la shell que está por defecto en casi todos los sistemas linux la cual es bash, mientras que en otros como AIX optan por shells como ksh, o pksh en OpenBSD y unos pocos como FreeBSD que vienen que con csh por defecto.

    Una de las razones por la que no se recomiendan las shells tipo C shell es por que su sintaxis es muy distinta de shells tipos bourne. Claro si se tiene interés en C entonces se pueden hacer cosas en csh o tcsh que tienen una sintaxis muy parecida al lenguaje C ¿Por algo el nombre de estás shells no?...las razones que yo pueda dar son superficiales porque existen razones muchos más técnicas de porque usar estilo bourne sobre el estilo csh. :)




    ResponderEliminar

Dejá tu comentario