tankdthedruid

getlinks.sh

Mar 4th, 2012
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.74 KB | None | 0 0
  1. #!/bin/bash
  2. #============================================================
  3. #
  4. #          FILE:  getlinks
  5. #
  6. #         USAGE:  ./getlinks
  7. #
  8. #   DESCRIPTION: Retrieve all HTTP links from a URL
  9. #
  10. #       OPTIONS:  ---
  11. #  REQUIREMENTS:  lynx
  12. #          BUGS:  ---
  13. #         NOTES:  ---
  14. #        AUTHOR:  tankd
  15. #       COMPANY:  ---
  16. #       VERSION:  1.0
  17. #       CREATED:  01/17/12 01:42:08 PST
  18. #      REVISION:  ---
  19. #============================================================
  20.  
  21. # Set variable $INPUT equal to user input
  22. INPUT=$1
  23.  
  24. # Test for empty variable $INPUT and terminate
  25. if [[ $INPUT = "" ]]; then
  26.     echo Usage: getlinks [URL]...
  27.     exit 1
  28. fi
  29.  
  30. # Execute getlinks function
  31. lynx -dump $INPUT | grep -E --only-matching 'http.*'
Advertisement
Add Comment
Please, Sign In to add comment