Last active
February 11, 2017 17:22
-
-
Save nhocki/00d9659a14c837160d3c12e6e1bf3cc9 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
CMD=${1:-false} | |
URL=${2:-example.com} | |
if [ $CMD = false ]; then | |
echo "usage: " $0 "command [url:example.com]" | |
exit 1 | |
fi | |
{ time $CMD > cmd.out 2> cmd.err ; } 2> time.out | |
if [ $? = 0 ]; | |
then | |
echo "+ time:" | |
cat time.out | |
echo | |
echo "+ curling baby:" | |
curl $URL | |
else | |
echo "+ Error:" | |
cat cmd.err | |
fi | |
# { time tree /var > cmd.out 2> cmd.err ; } 2> time.out; if [ $? = 0 ]; then cat time.out; curl example.com; else cat cmd.err; fi ` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment