• !/usr/bin/env bash
  • Menu 菜单练习

    !/usr/bin/env bash

    menu(){ cat << END 1.[install lamp] 2.[install lnmp] 3.[exit] pls input num: END } menu read num [[ "$num" == "1" ]]&&{ echo "start install lamp" [[ -x /server/scripts/lamp.sh ]]||exit 2 /bin/sh /server/scripts/lamp.sh exit 0 } [[ "$num" == "2" ]]&&{ echo "start install lamp" [[ -x /server/scripts/lnmp.sh ]]||exit 2 /bin/sh /server/scripts/lnmp.sh exit 0 } [[ "$num" == "3" ]]&&{ echo "bye" exit 0 } echo "error" exit 1

    上一篇:Tee 命令

    下一篇:Practical vim 第十章 复制与粘贴