1.set
环境变量:用来定义bash的工作特性,保存当前会话的属性信息
显示所有环境变量:export ,env ,printenv
2.bash的配置文件
profile:为交互式登录用户提供配置
/etc/profile:全局
/etc/profile/*.sh
~/bash/profile:个人配置,仅当前用户有效
bashrc:非交互式登录的用户提供配置
/etc/bashrc:全局
~/.bashrc:个人配置
交互式登录:直接通过终端输入用户信息登录系统
非交互式登录:su userName,图形界面的终端
3.proflie
设定环境变量
运行命令或角本
4.bashrc
设定本地变量
定义命令别名
5.source
重读配置文件命令,source . 缩写(.)
6.交互式登录用户
/etc/profile --> /etc/profile.d/*.sh --> ~/.bash_profile --> /etc/bashrc
非交互式登录用户
~/.bashrc --> /etc/bashrc -->/etc/profile.d/*.s
7.bash -n 脚本文件: 脚本语法错误检测
8.for循环
for var_Name in 列表 ; do
语句1
2
。
done
9.列表生成
生成数字序列 {start...end} seq[sart][setp]endlinux set profile bashrc source 非交互/交互式用户登录 for循环
原创
©著作权归作者所有:来自51CTO博客作者wanglm510的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章

















