我需要编辑 shell 脚本的时候 bash 是有高亮的,它这便是怎么选择的。各位请问
#!bin/bash
NGX_FILES=Nginx-1.16.tar.gz
PHP_FILES=php5.3.3.tar.gz
NGX_SRC=`echo $NGX_FILES| sed 's/\.tar\.gz//g'`
DWN_URL="包链接地址"
MYSQL_FILES=mysql-5.1.17.tar.gz
function nginx_install()
{
wget -c ${DWN_URL}/${NGX_SRC}
tar -xzf $NGX_FILES; cd NGX_SRC;./configure ;make ;make install
if [$0 -eq 0];then
echo "The Nginx install success!"
fi
}
function mysql_install()
{
tar -xzf $MYSQL_FILES ;cd mysql-5.1.17 ;.configure --prefix=/usr/local/mysql; make;make install
}
function php_install()
{
if [ -d /usr/local/mysql]; then
sql=/usr/local/mysql; make; make install
else
echo "Please pre install Mysql."
fi
}
PS3="Please Select your intsall Menu:"
select i in "Nginx" "Mysql" "PHP"
do
case $i in
Nginx)
nginx_install;;
Mysql)
mysql_install;;
php)
php_install;;
*)
echo "usage: $0{Nginx | Mysql | PHP | help}"
;;
esac
done
还有 shell 语法高亮
#!bin/bash
NGX_FILES=Nginx-1.16.tar.gz
PHP_FILES=php5.3.3.tar.gz
NGX_SRC=`echo $NGX_FILES| sed 's/\.tar\.gz//g'`
DWN_URL="包链接地址"
MYSQL_FILES=mysql-5.1.17.tar.gz
function nginx_install()
{
wget -c ${DWN_URL}/${NGX_SRC}
tar -xzf $NGX_FILES; cd NGX_SRC;./configure ;make ;make install
if [$0 -eq 0];then
echo "The Nginx install success!"
fi
}
function mysql_install()
{
tar -xzf $MYSQL_FILES ;cd mysql-5.1.17 ;.configure --prefix=/usr/local/mysql; make;make install
}
function php_install()
{
if [ -d /usr/local/mysql]; then
sql=/usr/local/mysql; make; make install
else
echo "Please pre install Mysql."
fi
}
PS3="Please Select your intsall Menu:"
select i in "Nginx" "Mysql" "PHP"
do
case $i in
Nginx)
nginx_install;;
Mysql)
mysql_install;;
php)
php_install;;
*)
echo "usage: $0{Nginx | Mysql | PHP | help}"
;;
esac
done