bash

bash -vx ./b
-v 显示命令
-x 显示一条一条

#!/bin/bash
read AAA
if [ $AAA = shrek ]
	then
		echo hello shrek
	elif   [ $AAA = "root" ]
		then echo hello root
	else
		echo 'get out here !'
fi



case 命令
read BBB
case $BBB in
		shrek)
			echo hello, shrek
			echo nice to meet you
			;;
		root)
			echo hello, root
			echo nice to meet you too
			;;
		*)
			echo hello “笨蛋”
			;;
esac

你可能感兴趣的:(bash)