Advertisement
JamesTan

Untitled

Feb 21st, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.97 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. RED='\033[31m'
  4. GREEN='\033[32m'
  5. BLUE='\033[34m'
  6.  
  7. echo Task 3 Registration Form
  8. read -p "Please enter your Name :" NAME
  9. read -p "Please enter your date of Birth :" BIRTHDAY
  10. read -p "Please enter your live Address :" ADDRESS
  11. read -p "Please enter your favorite Color (RED/GREEN/BLUE):" COLOR
  12.  
  13. if [ "$COLOR" = "RED" ]; then
  14.  echo -e "${RED}Your Name = $NAME"
  15.  echo -e "${RED}$NAME's date of Birth = $BIRTHDAY"
  16.  echo -e "${RED}$NAME's Address = $ADDRESS"
  17.  echo -e "${RED}$NAME's favorite Color = $COLOR"
  18. elif [ "$COLOR" = "GREEN" ]; then
  19.  echo -e "${GREEN}Your Name is $NAME"
  20.  echo -e "${GREEN}$NAME's date of Birth = $BIRTHDAY"
  21.  echo -e "${GREEN}$NAME's Address = $ADDRESS"
  22.  echo -e "${GREEN}$NAME's favorite Color =  $COLOR"
  23. elif [ "$COLOR" = "BLUE" ]; then
  24.  echo -e "${BLUE}Your Name is $NAME"
  25.  echo -e "${BLUE}$NAME's date of Birth = $BIRTHDAY"
  26.  echo -e "${BLUE}$NAME's Address = $ADDRESS"
  27.  echo -e "${BLUE}$NAME's favorite Color = $COLOR"
  28. fi
  29. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement