Hi
I have a wrapper script that I call, passing a number of parameters ...
wMFM.sh -p 83 -w '20041001 18550900' -r 83 '-a -nls _.UTF8'
parameter names -p, -w and -r are always present. -a is a list of additional parameters that may be used. If I echo the count of parameters I get 7 since the date is passed as one field as is the list of additional parameters.
The script is ksh and after doing a bit of work the idea is that I pass on the parameters to the program that I wish to run (previously the calling routine would have done this directly).
So I store the above values to a variable - $PLIST
Then call my program...
MFM $PLIST
However MFM complains because the now the parameter list effectively looks like this (quotes added by me to show elements)...
'-p' '83' '-w' '20041001' '18550900' '-r' '83' '-a' '-nls' '_.UTF8'
Since MFM is expecting the date in the format YYYYMMDD HHMISSTT it fails.
I have tried to format the $PLIST variable so it looks like when I echo it....
-p 83 -w '20041001 18550900' -r 83 '-a -nls _.UTF8'
but I get the same problem. Howevre if I make a call to MFM using the hard-coded value of above then it works.. i.e.
MFM -p 83 -w '20041001 18550900' -r 83 '-a -nls _.UTF8'
I have even tried to store each parameter to an array and then pass these to the MFM like...
MFM ${A[1]} ${A[2]} ${A[3]} echo `\'${A[4]} ${A[5]}\'` ....
but I still get the error. I guess that this is being cause by some kind of substitution of the '' at runtime but I cannot figure out how to fix this.
Any ideas would be appreciated.
Thanks in advance.