Does any one or more parameter have a whitespace in it not contained inside quotes?
If so perhaps this is the reason. Without much more info like:-
1) OS in use.
2) Shell version in use.
3) A little more of your code to give us more insight as to what is going on.
4) Anything else that might be useful.
USERNAME="$1"
export USERNAME
REMOTE_SERVER="$2"
export REMOTE_SERVER
LOCAL_DIRECTORY="$3"
export LOCAL_DIRECTORY
REMOTE_DIRECTORY="$4"
export REMOTE_DIRECTORY
DIRECTION="$5"
export DIRECTION
LOG_FILEPATH="$6"
export LOG_FILEPATH
LOG_FILENAME="$7"
export LOG_FILENAME
BIN_PATH="$8"
export BIN_PATH
LOCAL_JOBNAME="$9"
export LOCAL_JOBNAME
REMOTE_JOBNAME="$10"
export REMOTE_JOBNAME
##Validating if all inputs were entered
echo "Entering the program `date`"
if [ $# -ne 10 ]
then
echo "One or more inputs to this program were not entered."
echo "Please verify the Appworx module"
echo "Aborting the program on `date`"
exit 1
else
echo "All inputs to this program have been entered"
fi
Example longhand OSX 10.7.5 default bash terminal:-
Last login: Wed Sep 7 20:38:15 on ttys000
AMIGA:barrywalker~> test()
> {
> echo $#
> }
AMIGA:barrywalker~> test "Hello World everybody"
1
AMIGA:barrywalker~> test Hello World everybody
3
AMIGA:barrywalker~>
With this code, you would reject the input with "Not entered", if the caller supplied MORE than 4 parameters. This is at least a confusing error message. Here is how I would write it in bash:
if (( $# < 4 ))
then
echo Only $# parameters supplied, 4 expected
elif (( $# > 4 ))
then
echo You entered $(( $# - 4 )) 'parameter(s)' too many
fi