Hi there,
am trying to pass a parameter with a space in ksh via variables.
Here is some sample code to demonstrate the issue. As you will see the parameter with the space is later handled as two variables - not what I am after.
Update - I didn't copy and paste all the code in the origianl question. *
Contents of param_test.sh
#!/bin/ksh
echo "check 1"
param_string=${1}
param_string2=${2}
echo "check 2"
echo param_string = $param_string
echo param_string2 = $param_string2
echo "check 3"
Contents of call_param_test.sh
#!/bin/ksh
param_test.sh 'a b' c
CMD="param_test.sh 'a b' c"
# CMD=param_test.sh
# CMD="${CMD} 'a b c'"
echo CMD is $CMD
echo now running CMD
${CMD}
echo back to calling script
echo at end
Results of executing call_param_test.sh
check 1
check 2
param_string = a b
param_string2 = c
check 3
CMD is param_test.sh 'a b' c
now running CMD
check 1
check 2
param_string = 'a
param_string2 = b'
check 3
back to calling script
at end
Thanks,