QuickTips | Qual Unix SHELL estou utilizando?

Para responder a  pergunta acima, digite o seguinte comando em sua  Unix SHELL:

$ ps -p $$

O resultado é semelhante a este:

   PID TTY       TIME COMMAND
 18954 pts/24    0:00 ksh

ksh: Neste caso estamos utilizando Korn Shell.


2 thoughts on “QuickTips | Qual Unix SHELL estou utilizando?

  1. Ou você pode simplesmente pegar a variável de ambiente

    SHELL

    This variable contains the full path name of the current shell. Note that if SHELL is not defined, all commands that require the full path name of the current shell use the contents of the environment variable COMSPEC.

    psych0@FSS:~$ echo $SHELL
    /bin/bash

    ou se você realmente somente quer o nome do shell

    psych0@FSS:~$ echo $(basename $SHELL)
    bash

    Valeu,

    psych0.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s