/usr/bin/bash: Difference between revisions

Line 74: Line 74:


== ARGUMENTS ==
== ARGUMENTS ==
      If  arguments  remain after option processing, and neither the -c nor the -s option has been sup‐
オプション処理後に引数が残り、-cオプションも-sオプションも指定されていない場合、最初の引数はシェルコマンドを含むファイル名とみなされる。 この方法でbashが起動されると、$0にファイル名が設定され、位置パラメーターに残りの引数が設定される。 Bashはこのファイルからコマンドを読み込んで実行し、終了する。Bashの終了ステータスは、スクリプト内で最後に実行されたコマンドの終了ステータスである。 コマンドが実行されなかった場合、
      plied, the first argument is assumed to be the name of a file containing shell commands.  If bash
まず、カレントディレクトリのファイルを開こうとし、ファイルが見つからなければ、PATH内のディレクトリからスクリプトを探す。
      is  invoked in this fashion, $0 is set to the name of the file, and the positional parameters are
      set to the remaining arguments.  Bash reads and executes commands from  this  file,  then  exits.
      Bash's exit status is the exit status of the last command executed in the script.  If no commands
      are executed, the exit status is 0.  An attempt is first made to open the file in the current di‐
      rectory,  and,  if  no  file  is  found,  then the shell searches the directories in PATH for the
      script.


== INVOCATION ==
== INVOCATION ==