-
-
Save bennygit/6011589 to your computer and use it in GitHub Desktop.
Open Root class docu from command line.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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