shell case basis of applications

A wear member in the named /root/script.sh server0 script, to furnish the following features to
    1. When operating /root/script.sh all, none of the output

    2. When running /root/script.sh none, all output

    3. When there is no argument or the argument is not all or none, which is what generates the error output information /root/script.sh all | none

1 ! # / Bin / bash
 2  Case $ 1  in 
3  none)
 4  echo  " All " ;;
 5  All)
 6  echo  " none " ;;
 7 * )
 8  echo  " Please enter the correct parameters: All | none " ;;
 9  esac

Guess you like

Origin www.cnblogs.com/renyz/p/11307835.html