Skip to content

Instantly share code, notes, and snippets.

@jclosure
Created September 17, 2015 20:00
Show Gist options
  • Save jclosure/5f34b4a64105f1040ff1 to your computer and use it in GitHub Desktop.
Save jclosure/5f34b4a64105f1040ff1 to your computer and use it in GitHub Desktop.
skeletal starter for scripts that require files in fs as args
#!/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