1.BASH(bourne again shell )
cmd1 ;cmd2等同于 cmd1 cmd2
2.echo music; 中的分号不被打印出,因为分号默认为命令定界符号
3.利用pgrep找出进程的环境变量
[[email protected] shell]$ pgrep compiz 4924 [[email protected] shell]$ cat /proc/4924/environ ORBIT_SOCKETDIR=/tmp/orbit-carltonHOSTNAME=oc3408554812.ibm.comIMSETTINGS_INTEGR #省略很多
4.打印出彩色字体
#! /bin/bash echo -e "\e[1;31m This is red test \e[0m"
5.环境变量浅析
#!/bin/bash fruit=apple count=6 echo "we have $count ${fruit}(HAHA)" 运行结果: we have 6 apple(HAHA)
6.增加环境变量
PATH="$PATH:/home/usr/bin" export PATH echo $PATH #会显示上面定义的变量
时间: 2024-10-07 17:44:04