Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #============================================================
- #
- # FILE: getlinks
- #
- # USAGE: ./getlinks
- #
- # DESCRIPTION: Retrieve all HTTP links from a URL
- #
- # OPTIONS: ---
- # REQUIREMENTS: lynx
- # BUGS: ---
- # NOTES: ---
- # AUTHOR: tankd
- # COMPANY: ---
- # VERSION: 1.0
- # CREATED: 01/17/12 01:42:08 PST
- # REVISION: ---
- #============================================================
- # Set variable $INPUT equal to user input
- INPUT=$1
- # Test for empty variable $INPUT and terminate
- if [[ $INPUT = "" ]]; then
- echo Usage: getlinks [URL]...
- exit 1
- fi
- # Execute getlinks function
- lynx -dump $INPUT | grep -E --only-matching 'http.*'
Advertisement
Add Comment
Please, Sign In to add comment