SHARE
TWEET

Untitled

a guest Oct 20th, 2019 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #Mateusz Rus gr1
  3. function help_display {
  4.   echo "program wyswietla nazwe uzytkownika zalogowanego"
  5.   exit 0
  6. }
  7.  
  8. if [ -z "$*" ]; then
  9.   echo "3opcja"
  10.   FULLNAME=$(getent passwd $USER | cut -d : -f 5)
  11.   echo $FULLNAME
  12.   exit 0
  13. fi
  14. if [[ "$@" =~ "-h" ]] ; then
  15.     help_display
  16. fi
  17. for var in "$@"
  18. do
  19. if [ "$var" == "-h" ] ; then
  20.     help_display
  21. elif [ "$var" == "-q" ] ; then
  22.   break
  23. elif [[ "$var" != "-h" ]] || [[ "$var" != "" ]] ; then
  24.   echo "nieobsługiwane polecenie wyswietlam pomoc"
  25.   help_display
  26. elif [ [ "$var" == "-h" ] && [ "$var" == "-q" ] ] ; then
  27.   help_display
  28. fi
  29. done
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top