enable  シェル・コマンド 有効 無効

今日はenableコマンドについてのお勉強です。

enableコマンド構文   】
enable [-a] [-np] コマンド名 

【 enableオプション   】

-a 有効の場合
-n 無効の場合


上記の オプションを付けて
シェル・コマンドの有効の一覧・無効の一覧を表示します。

-n 
シェル・コマンドを無効化・使えなくします。

-p 
現在有効・使用できるシェル・コマンドのリストを表示します。
nオプションと組み合わて-pnオプションでenableコマンドを実行すると
現在無効・使用できないシェル・コマンドのリストを表示する
 

 【enable説明 】
指定したシェル・コマンドのみを有効化する。

また、無効にすることもできる。

enableコマンド自体を無効にすると

実行したシェル内では再び有効にできないので

注意が必要です。



【 enable使用例   】
helpコマンドを無効化する
    [oguraan@localhost ~]$ enable -n help
    [oguraan@localhost ~]$ enable -pn
    enable -n help
    [oguraan@localhost ~]$ help
    -bash: help: command not found
    [oguraan@localhost ~]$ enable -a help
    [oguraan@localhost ~]$ enable -pn
    [oguraan@localhost ~]$ help
    GNU bash, version 3.2.33(1)-release (i386-redhat-linux-gnu)
    These shell commands are defined internally.  Type `help' to see this list.
    Type `help name' to find out more about the function `name'.
    Use `info bash' to find out more about the shell in general.
    Use `man -k' or `info' to find out more about commands not in this list.

    A star (*) next to a name means that the command is disabled.




現在有効なシェル・コマンドの一覧を表示する
    [oguraan@localhost ~]$ enable -p
    enable .
    enable :
    enable [
    enable alias
    enable bg
    enable bind
    enable break

    省略・・・・





       enable [-adnps] [-f filename] [name ...]
              Enable and disable builtin shell  commands.   Disabling  a  builtin
              allows a disk command which has the same name as a shell builtin to
              be executed without specifying a full  pathname,  even  though  the
              shell  normally  searches for builtins before disk commands.  If -n
              is used, each name is disabled; otherwise, names are enabled.   For
              example,  to  use the test binary found via the PATH instead of the
              shell builtin version, run ''enable -n test''.  The -f option means
              to  load  the new builtin command name from shared object filename,
              on systems that support dynamic loading.  The -d option will delete
              a  builtin  previously  loaded  with  -f.  If no name arguments are
              given, or if the -p option is supplied, a list of shell builtins is
              printed.   With no other option arguments, the list consists of all
              enabled shell builtins.  If -n is supplied, only disabled  builtins
              are  printed.   If  -a  is  supplied, the list printed includes all
              builtins, with an indication of whether or not each is enabled.  If
              -s  is  supplied,  the  output  is  restricted to the POSIX special
              builtins.  The return value is 0 unless  a  name  is  not  a  shell
              builtin  or  there  is an error loading a new builtin from a shared
              object.


サーバ運用(ランキング)


blogram投票ボタン




サーバ構築(ランキング)を見る。



トラックバック(0)

このブログ記事を参照しているブログ一覧: enable  シェル・コマンド 有効 無効

このブログ記事に対するトラックバックURL: http://websky21.com/MT/mt-tb.cgi/903