1、elasticsearch启动脚本
1 #!/bin/bash 2 export JAVA_HOME=/usr/java/jdk1.8.0_201-amd64 3 export JAVA_BIN=/usr/java/jdk1.8.0_201-amd64/bin 4 export PATH=$JAVA_BIN:$PATH 5 export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 6 export JAVA_HOME JAVA_BIN PATH CLASSPATH 7 . /etc/init.d/functions 8 function echo_point() 9 {10 min=111 max=212 while [ $min -le $max ]13 do14 for((i=0;i<4;i++))15 do16 printf "."17 sleep 118 done19 min=`expr $min + 1` 20 done21 printf " "22 }23 24 25 case $1 in26 start)27 28 su - elasticsearch<
2、循环输出退格省略号
1 #!/bin/sh 2 function start_pro() 3 { 4 min=1 5 max=2 6 while [ $min -le $max ] 7 do 8 for((i=0;i<6;i++)) 9 do10 printf "."11 #printf " "12 #printf "\b"13 sleep 114 done15 tab16 min=`expr $min + 1` #i++17 #printf $min18 done19 printf "\n"20 }21 22 23 function tab()24 {25 for((i=0;i<6;i++))26 do27 printf "\b" #退回28 sleep 129 done30 }31 32 33 34 35 case $1 in36 start)37 start_pro38 ;;39 stop)40 echo "stop....."41 ;;42 esac