Shell中关于exit 0的那些坑

  #/bin/bash

  function check_extern_input()

  {

  read param

  if [ "${param}" == "exit 0" ]

  then

  echo "successful exit process right now!"

  exit 0

  elif [ "${param}" == "exit 1" ]

  then

  echo "failed exit process right now!"

  exit 1

  elif [ "${param}" == "return 0" ]

  then

  echo "func normal return, process not exit, Enter go on..."

  return 0

  else

  echo "Input again:"

  fi

  }

  while true

  do

  check_extern_input

  done