builtin command 調べ中
きっかけ
man cd
をたたいた。
BUILTIN(1) BSD General Commands Manual BUILTIN(1) NAME builtin, !, %, ., :, @, {, }, alias, alloc, bg, bind, bindkey, break, breaksw, builtins, case, cd, chdir, command, complete, continue, default, dirs, do, done, echo, echotc, elif, else, end, endif, endsw, esac, eval, exec, exit, export, false, fc, fg, filetest, fi, for, foreach, getopts, glob, goto, hash, hashstat, history, hup, if, jobid, jobs, kill, limit, local, log, login, logout, ls-F, nice, nohup, notify, onintr, popd, printenv, pushd, pwd, read, readonly, rehash, repeat, return, sched, set, setenv, settc, setty, setvar, shift, source, stop, suspend, switch, telltc, test, then, time, times, trap, true, type, ulimit, umask, unalias, uncomplete, unhash, unlimit, unset, unsetenv, until, wait, where, which, while -- shell built-in commands SYNOPSIS builtin [-options] [args ...] DESCRIPTION Shell builtin commands are commands that can be executed within the running shell's process. Note that, in the case of csh(1) builtin commands, the command is executed in a subshell if it occurs as any component of a pipeline except the last. :
cd
単独の説明がでると思っていたのにそうじゃなかった。
Shell builtin commands というのは、何か特別らしい。
まずは man を読んでみる。
DESCRIPTION Shell builtin commands are commands that can be executed within the running shell's process. Note that, in the case of csh(1) builtin commands, the command is executed in a subshell if it occurs as any component of a pipeline except the last. If a command specified to the shell contains a slash ``/'', the shell will not execute a builtin com- mand, even if the last component of the specified command matches the name of a builtin command. Thus, while specifying ``echo'' causes a builtin command to be executed under shells that support the echo builtin command, specifying ``/bin/echo'' or ``./echo'' does not. While some builtin commands may exist in more than one shell, their operation may be different under each shell which supports them. Below is a table which lists shell builtin commands, the standard shells that support them and whether they exist as standalone utilities. Only builtin commands for the csh(1) and sh(1) shells are listed here. Consult a shell's manual page for details on the operation of its builtin commands. Beware that the sh(1) manual page, at least, calls some of these commands ``built-in commands'' and some of them ``reserved words''. Users of other shells may need to consult an info(1) page or other sources of documentation. Commands marked ``No**'' under External do exist externally, but are implemented as scripts using a builtin command of the same name.
↓ jman
解説 シェル組み込みコマンドは、実行中のシェルプロセス内で実行されるコマンドです。 csh(1) 組み込みコマンドの 場合、パイプラインの構成要素として登場する場合には、最後の構成要素である場合を除き、コマンドはサブシェ ル内で実行されます。 シェルに対して指定されたコマンドがスラッシュ ``/'' を含む場合、指定したコマンドの最後の部分が組み込み コマンドの名前とマッチする場合でも、シェルは組み込みコマンドを実行しません。それ故、組み込み echo コマ ンドをサポートするシェルでは ``echo'' は組み込みコマンドを実行させますが、 ``/bin/echo'' や ``./echo'' は組み込みコマンドを実行させません。 複数のシェルに存在する組み込みコマンドもありますが、それらの動作はこれをサポートする各シェルで異なるか もしれません。下表は、シェル組み込みコマンドと、これらをサポートする標準シェルと、独立ユーティリティと して存在するか否かを列挙しています ここには csh(1) と sh(1) の組み込みコマンドだけを列挙しています。これらのシェルのもとでの各組み込みコ マンドの動作の詳細は、適切なマニュアルページを参照してください。他のシェルのユーザは、そのシェルと共に 提供される文書を参照する必要があるでしょう。
よくわからない。
ネットの記事を読む
この記事がわかりやすかった。 ビルトインコマンドのメモ | OpenGroove