分类: LINUX
2009-11-12 16:17:53
1. source命令和点命令(.)
(1)source命令和点命令是两个等价的命令。例: source filename 等价于 . filename 。
(2)source命令在当前bash环境下执行filename,通常用于重新执行刚修改的初始化文件,使之立即生效,而不必注销并重新登录。这个filename不需要具有可执行权限。
(3)shell脚本(scripts)可以直接运行,而不需要由source命令或点命令来启动,因为shell会启动一个子shell去运行scripts,只要scripts文件具有可执行权限。
(4)source命令和点命令都属于builtin命令,即shell的内置命令,所以在linux系统中找不到source命令和点命令所在的目录。
2. builtin
A. builtin定义:
In computing, a shell builtin is a command or a function, called from a shell, that is executed directly in the shell itself, instead of an external executable program which the shell would load and execute.
B. builtin命令集:
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, trap, true, type, ulimit, umask,unalias, uncomplete,
unhash, unlimit, unset, unsetenv, until, wait, where, which, while
引用来源:
<--文章完-->