Don't like ads? PRO users don't see any ads ;-)
Guest

week6.sh

By: a guest on Jun 30th, 2012  |  syntax: Bash  |  size: 0.82 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #
  2. #
  3. #   ********************************************************************
  4. #   *                                                                  *
  5. #   * Week 6 Script Assignment - a basic script to show the # of users *
  6. #   *                            logged in to the student server.      *
  7. #   *                                                                  *
  8. #   ********************************************************************
  9. #
  10. #                              by: bvs245
  11. #
  12. #
  13. echo "let's see how many users are currently logged on to the student server"
  14. #
  15. sleep 2
  16. echo
  17. set `who | wc -l`
  18. users=$1
  19. if [ "$users" -lt 9 ]
  20. then
  21.     echo "There are less than 10 users currently signed on."
  22. elif [ "$users" -lt 11 ]
  23. then
  24.     echo "There are currently "$users" users signed on the server"
  25. fi
  26. #
  27. #
  28. #  end