Created
September 17, 2015 20:00
-
-
Save jclosure/5f34b4a64105f1040ff1 to your computer and use it in GitHub Desktop.
skeletal starter for scripts that require files in fs as args
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 | |
FILE=$1 | |
################################################################################## | |
function usage(){ | |
echo "usage: $(basename $0) /path/to/java-rpm-file.rpm" | |
} | |
################################################################################## | |
if [ -z "$FILE" ]; then | |
echo "file is unset"; | |
else | |
echo "file is set to '$FILE'"; | |
OK=true | |
fi | |
if [ "$OK" = true ] && [ -f $FILE ]; then | |
echo "File $FILE exists." | |
else | |
echo "File $FILE does not exist." | |
OK=false | |
fi | |
if [ "$OK" = true ]; then | |
echo "proceeding with install" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment