yuanqiao 发表于 2018-8-25 12:22:26

SHELL笔记9

1 #! /bin/bash  
2 #filename:a.sh
  
3 i=1
  
4 while [ "$i" -eq 1 ]
  
5 do
  
6   RESPONSE=
  
7   echo "-----------------------------------------------"
  
8   echo "Please choice:"
  
9   echo "Input -- start -- start program myfiles."
  
10   echo "Input -- stop --view status of myfiles process."
  
11   echo "Input -- quit -- exit."
  
12   echo "-----------------------------------------------"
  
13   read RESPONSE
  
14   case $RESPONSE in
  
15   start) ./myfiles&;;
  
16   stop) killall myfiles;;
  
17   status) ps -aux | grep myfiles;;
  
18   quit) i=0
  
19       echo "Quit,Thanks"
  
20       ;;
  
21   esac
  
22 done


页: [1]
查看完整版本: SHELL笔记9