shell 中 source 用法
来源:互联网 发布:词组贝多芬知乎 编辑:程序博客网 时间:2024/06/05 23:08
source命令:
source命令也称为“点命令”,也就是一个点符号(.)。source命令通常用于重新执行刚修改的初始化文件,使之立即生效,而不必注销并重新登录。
用法:
source filename 或 . filename
source命令除了上述的用途之外,还有一个另外一个用途。在对编译系统核心时常常需要输入一长串的命令,如:
make mrproper
make menuconfig
make dep
make clean
make bzImage
…………
如果把这些命令做成一个文件,让它自动顺序执行,对于需要多次反复编译系统核心的用户来说会很方便,而用source命令就可以做到这一点,它的作用就是把一个文件的内容当成shell来执行,先在linux的源代码目录下(如/usr/src/linux-2.4.20)建立一个文件,如make_command,在其中输入一下内容:
make mrproper &&
make menuconfig &&
make dep &&
make clean &&
make bzImage &&
make modules &&
make modules_install &&
cp arch/i386/boot/bzImage /boot/vmlinuz_new &&
cp System.map /boot &&
vi /etc/lilo.conf &&
lilo -v
文件建立好之后,每次编译核心的时候,只需要在/usr/src/linux-2.4.20下输入:
source make_command
即可,如果你用的不是lilo来引导系统,可以把最后两行去掉,配置自己的引导程序来引导内核。
顺便补充一点,&&命令表示顺序执行由它连接的命令,但是只有它之前的命令成功执行完成了之后才可以继续执行它后面的命令。
- shell 中 source 用法
- shell中source命令
- linux shell 中source 命令
- shell中source与export
- shell 函数和source命令用法
- linux中source的用法
- shell文件中set setenv source(zz)
- shell脚本中source有关问题
- shell中“source”、“.”和“bash”命令
- Linux bash shell中. & source & ./的区别
- shell中source sh exec的区别
- shell中source和export区别
- SHELL中for用法
- shell中eval用法
- shell中complete用法
- Shell 中{},[],()用法大全
- shell中IFS用法
- shell中${ } 用法详解
- 数独问题之排除法和唯余法
- 基数树(radix tree)
- 关机 重启 BAT
- 关于C++中的虚拟继承的一些总结
- Linux tty 终端设备驱动
- shell 中 source 用法
- C#链表;双向链表
- 通过设计让APP变快的6个方法
- Hbase API管理功能2-HBaseAdmin
- sametime闪烁问题解决
- C++静态函数的作用
- ISO8583报文协议
- 微软SQLHelper.cs类 中文版
- JavaScript 中使用JSON