shell脚本之case语句及select综合应用

#!/bin/bash

ps3="select you will exex menu:"
select i in "Apache"  "Msyql" "PHP"

do
case $i in

        Apache )
        echo "wait install httpd server..."
        tar jvxf httpd-2.4.41.tar.bz2 ;cd httpd-2.4.41
        ;;
        Mysql )
        echo "wait install Mysql server..."

        ;;
        PHP  )
        echo "wait install PHP server..."
        ;;
        *    )
        echo  "usage: { $0 Apache|Mysql|PHP|help}"
        ;;
esac
done

在这里我只是为了将脚本书写出来,并没有真正的去下载lamp架构所需要的东西。

你可能感兴趣的:(运维)