Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #!/bin/tcsh
  2. #Kamil Milik grupa 2
  3.  
  4. set fullName=`getent passwd "$USER" | cut -d: -f5 | cut -d, -f1`
  5. set loginInfo=`whoami`
  6.  
  7. alias show_help echo "HELP: The program provides login and first and last name. The author of the program: Kamil Milik"
  8.  
  9. foreach param ($*)
  10. if ( "$param" == "-h" || "$param" == "--help" ) then
  11. show_help
  12. exit 0
  13. endif
  14. end
  15.  
  16. foreach param ($*)
  17. if ( "$param" == "-q" || "$param" == "--quiet" ) then
  18. exit 0
  19. endif
  20. end
  21.  
  22. foreach param ($*)
  23. if( "$param" =~ -* ) then
  24. echo "Incorrect option $param"
  25. show_help
  26. exit 1
  27. endif
  28. end
  29. echo "Login: $loginInfo"
  30. echo "User name: $fullName"
  31. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement