Skip to content

Instantly share code, notes, and snippets.

@bennygit
Forked from alexpearce/rootdocs.sh
Last active December 19, 2015 20:09
Show Gist options
  • Save bennygit/6011589 to your computer and use it in GitHub Desktop.
Save bennygit/6011589 to your computer and use it in GitHub Desktop.
Open Root class docu from command line.
#!/bin/bash
function bail {
echo You did not enter a valid ROOT class $1
exit 1
}
if [ -n "$1" ]; then
if [ `expr match $1 T` == 1 ]; then
status_code=`curl -o /dev/null -sIw "%{http_code}" http://root.cern.ch/root/html/$1.html`
if [ $status_code == 200 ]; then
xdg-open http://root.cern.ch/root/html/$1.html &
else bail \(404\)
fi
else bail
fi
else bail
fi
unset status_code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment