I was asked to write a bash script for upgrading our OC4J application. They want me to add an option to not back up a specific directory. There's a folder called application-deployments/iemp/ that we want the option. By default, it copies and saves the data, but we want to add something like --nodeployments that will not include that folder to be tar'd and later untar'd.
Here's now it normally looks:
# new-iemp.sh iemp.ear
We want it to look like this:
# new-iemp.sh --nodeployments iemp.ear
In my script, I reference the file, iemp.ear in this example, as $1. I initially tried to add this flag after the file as a $2, but I couldn't get the result I was hoping for. I've searched several times on Google but I can't find what I'm looking for, can someone help me out? I can attach the script so far (without any flag-stuff) if that would help.
Thanks in advance!