# drop in a function
fetch() { (echo -ne "GET $2 HTTP/1.0\r\nHost: $1\n\r\n"; sleep 5) | \
openssl s_client -connect $1:443 -quiet -msgfile /dev/null | \
perl -pe 'BEGIN { while (<>) { last if $_ eq "\r\n"; } }';
}
# call the function, manually splitting host and uri and dropping scheme
fetch "raw.githubusercontent.com" "/gabrielelana/mongodb-shell-extensions/master/released/mongorc.js" > /tmp/.mongorc.js
Last active
April 17, 2020 10:47
-
-
Save robshep/54095e5ed9811d904ad441f460b08a08 to your computer and use it in GitHub Desktop.
Linux Shell Power Snippets
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment