输出hello world
vi test1
vi界面中编写shell,必须以#! /bin/sh开头
#! /bin/sh
$i="Hello World"
echo "$i"
保存退出
chmod 777 test1
./test1 查看是否输出Hello World
----------------------------------------------------------------
查看shell的目录是否为/bin/bash
vi test2
vi编辑
#! /bin/sh
if [ "$SHELL"="/bin/bash" ];then echo "your SHELL src is /bin/sh"
else
echo "your SHELL src $SHELL"
fi
同样执行 chmod 777 test2 接着./test2
-------------------------------------------------------------