Advertisement
Guest User

Untitled

a guest
Oct 14th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. opc=$(getopt -o u:hp -l user:,help,password: -- "$@")
  4. eval set -- $opc
  5.  
  6. while true;do
  7.   case $1 in
  8.     -h|--help)
  9.       echo "Usuário pediu ajuda"
  10.       shift
  11.     ;;
  12.     -u|--user)
  13.       echo "O usuário é $2"
  14.       shift 2
  15.     ;;
  16.     -p|--password)
  17.       echo "A senha ássada é $2"
  18.       shift 2
  19.     ;;
  20.     --)
  21.       shift
  22.       break
  23.     ;;
  24.   esac
  25. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement