[color="#0001FF"]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命令和点命令所在的目录。
[color="#0001FF"]2. builtin[color="#FF0102"]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.[color="#FF0102"]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引用来源:
http://www.gsp.com/cgi-bin/man.cgi?section=1&topic=builtin
[color="#FF0102"]
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/97771/showart_2092752.html |