Is there any method thorugh which script can take argument if pass otherwise if argument doesn't pass then it takes the argument from the configuration file
i.e I am workiing on a script which will run through crontab and the script will
chekout the code ,zip and copy to the particular location.
But the script should be in this way
if someone pass the argument then it will checkout that code else if argument doesn't pass then it will take the argument from the configuration file.
In my opinion this is more logic than script problem. You can do something like:
# Check if you have arguments to your scripts (maybe using getopts)
# If not, check and load data from configuration file
if [ ${#} -eq 1 ]
then
zipCode=${1}
else
# Load configuration file
. <configuration file>
fi
I hope it helps! At least a start point for you...