Skip to content

Instantly share code, notes, and snippets.

@JupyterJones
Created October 4, 2018 02:18
Show Gist options
  • Save JupyterJones/749bd9c2e353fed7745dbc82cba8a1dd to your computer and use it in GitHub Desktop.
Save JupyterJones/749bd9c2e353fed7745dbc82cba8a1dd to your computer and use it in GitHub Desktop.
bash script view and save a webpage as -- currenttime.html -
#!/bin/bash
page="$(wget -O - $1)"
today=`date +%Y-%m-%d.%H:%M:%S`
new=$today".html"
echo "$page" >>$new
echo "$page"
@JupyterJones
Copy link
Author

save script

make executable:

chmod +x viewpage.sh
to view and save a page.
./viewpage https://jacknorthrup.com

Results printed in terminal AND saved as current date.html.
Example:
2018-10-04.10:12:34.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment