source in shell

source是csh(C Shell)的内置命令:
标识读入并执行文件中的命令.
这与执行shell脚本是不一样的./script.sh会启动一个新的shell并执行script.sh中的命令.
  source [-h] name [args ...]
  The shell reads and executes commands from name. The commands
  are not placed on the history list. If any args are given,
  they are placed in argv. (+) source commands may be nested; if
  they are nested too deeply the shell may run out of file
  descriptors. An error in a source at any level terminates all
  nested source commands. With -h, commands are placed on the
  history list instead of being executed, much like `history -L'.
=========================
sh (Bourne Shell)和ksh (Korn Shell)有一个类似的命令 . (点dot)
  . file The commands in the specified file are read and executed by the
  shell. The return command may be used to return to the . com-
  mand's caller. If file contains any ``/'' characters, it is used
  as is. Otherwise, the shell searches the PATH for the file. If
  it is not found in the PATH, it is sought in the current working
  directory.
========================
bash (GNU Bourne-Again Shell)是组合了sh/ksh/csh的特征同时支持(source)命令和(.)命令

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值