Korn Shell Variable values difference

I am using two shell scripts a.ksh and b.ksh

a.ksh

  1. Sets the value
    +++++++++++++++++
    export USER1=abcd1
    export PASSWORD=xyz
    +++++++++++++++++

b.ksh
2. Second scripts calls sctipt a.ksh and uses the values set in a.ksh and pass to an executable demo
++++++++++++++++++++++++++++++++++++++
. /local/home/Scripts/a.ksh
echo $USER1
echo $PASSWORD
demo -user "${USER1}" -password "${PASSWORD}"
++++++++++++++++++++++++++++++++++++++

Result
demo -user $'abcd1\r' -password $'xyz\r'

Problem is echo $USER1 and $PASSWORD both shows correct value as "abcd1" and "xyz",but when passed to demo executable it shows $'abcd1\r'. How to avoid these values when passed to external application.

K

Why do you think that the parameters are passed to the external program like this? Could you post the output of the following command:

ksh -xv ./b.ksh

Please put code inside [code] tags.

Did you edit a.ksh on a Windows box? When you do that, you must remove the carriage returns from the file before using it as a shell script.