Page 1 of 1

Passing parameter with spaces to Execute Command Stage

Posted: Tue Nov 19, 2013 5:26 am
by karry450
I am using an execute command stage passing some parameters

example: Overtime Reporting/Cubes

but my shell script is recognizing only Overtime instead of Overtime Reporting/Cubes value. Can any one help me on how to pass the parameters which has spaces in it?

Posted: Tue Nov 19, 2013 7:44 am
by crystal_pup
Try passing the values within double quotes

Posted: Tue Nov 19, 2013 4:05 pm
by ray.wurlod
The space character in the directory name is your problem. As noted, you can enclose the pathname, or the directory name, in quotes.

Posted: Tue Nov 19, 2013 5:01 pm
by asorrell
Option 2 - create a symbolic link (with no spaces in the name) to the target and use that.

Posted: Tue Nov 19, 2013 10:16 pm
by karry450
Hi Ray.

The double quotes for the directory or path doesnt work still the same issue can you please help if there are any other options apart from symbolic link.

Posted: Wed Nov 20, 2013 8:19 am
by chulett
See if this helps.

Posted: Wed Nov 20, 2013 10:45 am
by asorrell
Hmm - that option http://www-304.ibm.com/support/docview. ... wg21386517 should only help if he was using single quotes, and earlier karry450 said he tried double quotes.

karry450, can you post the exact string you are passing the parameter?

Posted: Wed Nov 20, 2013 10:21 pm
by karry450
Hi

I am passing 'Overtime Reporting/Cubes' as a parameter

Posted: Thu Nov 21, 2013 9:42 am
by asorrell
Ok - then either use Craig's recommended environment variable in your job or switch to double quotes (" not '), that should resolve it.

Posted: Thu Nov 21, 2013 11:29 pm
by karry450
Hi Andy,

"Overtime Reporting/Cubes" also didn't work.

Posted: Fri Nov 22, 2013 4:04 am
by crystal_pup
I created a sequence (no environment variable used) with only execute command activity and passed the following command (under the command option) in it :-

echo "Overtime Reporting/Cubes"

Output --> "Overtime Reporting/Cubes"

Then,
Passed following under command option - echo
Passed following under parameter option - "Overtime Reporting/Cubes"

Output --> "Overtime Reporting/Cubes"

Can you try the above and let us know what you see in the director log?
It could be that the datastage is passing the value correctly, but the shell script is not acknowledging it.

Posted: Fri Nov 22, 2013 8:24 am
by chulett
We really need to get past "doesn't work" to what the actual problem is and where it is happening. As noted, let's start with showing us what actually gets logged when the job starts as all parameters in play are logged in one of the first messages.

After that, if it looks ok, would be to show us how you are calling the script (what is where in the EC stage) and then how it is being used in your shell script. And I'd also be curious what you need to do from the command line to make your script work? If that's one value then it absolutely needs to be quoted otherwise the space turns it into two parameters.

Posted: Thu Nov 28, 2013 12:11 am
by karry450
crystal_pup wrote:Can you try the above and let us know what you see in the director log?
Hi
I have tried both the options

The output is as follows
Output --> Overtime Reporting/Cubes