I have identified a solution that works :)

When exporting the env variable, hit the enter key on the command line and 
keep adding lines and then close the quotes on the least line. This would 
look like the following:

*prompt:> export mycs='element /reuse /main/LATEST*
*> element /reuse/ip /main/LATEST*
*> element /reuse/ip/file.txt /main/LATEST'*

Then, test it out using echo with double quotes around the variable as:

*echo "$mycs"*

Once formatted as wanted, simply pass in the variable to the Jenkins CLI to 
be used on the other side like this:

*java -jar ~/files/jenkins-cli.jar -s http://<my jenkins url>  build -s 
'Fundamental/math-flex' -p DESCRIPTION="$mydesc" 
-p configspec_elements="$mycs"*

Hope this helps\you as much as it helped me :)

Denis

On Friday, December 11, 2015 at 5:15:07 PM UTC-5, DGaudet wrote:
>
> Hey folks, 
>
> I'm trying to pass a multiline parameter to a build from a BASH command 
> line. My command looks like this: 
>
> /java -jar ~/files/jenkins-cli.jar -s http://<my jenkins url>  build -s 
> 'Fundamental/math-flex' -p DESCRIPTION="$mydesc" -p 
> configspec_elements="$mycs"/ 
>
> I have exported both variables as: 
>
> /export mydesc='Dry run' 
> export mycs='element /reuse /main/LATEST\nelement /reuse/ip /main/LATEST'/ 
>
> When this gets into the jenkins job, the $mycs looks like this: 
>
> /element /reuse /main/LATEST\nelement /reuse/ip /main/LATEST/ 
>
> I was hoping/expecting the "\n" to have been expanded, but, it wasn't ;( 
>
> How else can I get multiple lines trough the CLI interface? 
>
> Thanks in advance for your help! 
>
> Denis

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/fa99dc58-7b6b-41d0-8378-57a2d4d2df1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to