Space in Prompts

Document ID : KB000089019
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
Space in Prompts
Resolution:
Symptoms
There is a known problem where when more than one whitespace characters are used next to each other, all but one gets stripped off.

This issue can be seen when a value like "123 456" is used in a prompt. When this prompt value is passed down to the script that is running it as a variable ($2 assuming this is the second prompt in the script), the value of $2 when echo'd out in the script is trimmed to "123 456". As it can be seen, all but one of the whitespace characters has been stripped off.

 
 
Resolution
 

The solution to the issue is to create a new Program Type script and assign jobs using these multiple whitespace prompts to use this Program Type. The Program Type script can be created as follows:

 

1) Create a shell script in the $AW_HOME/exec folder of the Agent(s) machine where the job runs, name it ONELINESHELLS and add the following content:

 

 

echo perl shell.pl $program $par

 

perl $AW_HOME/exec/shell.pl $program $par

 

err=$?

 

exit $err 

 

2) Create a perl script in $AW_HOME/exec folder of the Agent(s) machine where the job runs, name it shell.pl and add the following content:

 

 

open (FILE, "$ARGV[1]");

 

while (<FILE>) {

 

 chomp;

 

 $parfile = "$parfile $_"

 

}

 

print "par is $parfile\n";

 

print "sh $ARGV[0] $parfile\n";

 

system("sh $ARGV[0] $parfile");

 

 

3) Modify the job that contains the whitespace parameter to use the shell script ONELINESHELLS