Periods aren’t valid characters for a shell variable name, I can’t set one to
test this. Try using “${deploy.dir}” (as in “ls ${deploy.dir}”). If that
doesn’t work extracting it from your environment with env | grep | cut is going
to be the best you’ve got assuming you can’t give it a valid name.
From: [email protected] <[email protected]> On
Behalf Of Eric Fetzer
Sent: Friday, February 8, 2019 3:56 PM
To: Jenkins Users <[email protected]>
Subject: Re: Using a Variable in Execute Shell that has a . in it
That there is some crazy stuff Eric, but it worked, lol:
[OIS-Client] $ /bin/sh -xe /tmp/jenkins1618762877704683861.sh
++ grep 'deploy\.dir='
++ cut -d = -f 2
++ env
+ depdir=/deploy
+ echo 'deploy.dir == /deploy'
deploy.dir == /deploy
I can work that into this and avoid using an ant script or rewriting 15
different jobs, THANKS!!!
On Friday, February 8, 2019 at 10:25:17 AM UTC-7, Eric Fetzer wrote:
So it works fine to use a variable like build.dir as a parameter in a build
trigger. I'm finding, however, that when I add it to a "execute shell"
command, it gets cut off at the ".". For example:
Execute Shell:
Command: ls -l $deploy.dir
This tries to ls -l on .dir because $deploy is unset. I would very much
appreciate any help. I tried escaping the "." but that didn't work. I tried
putting quotes around the variable, no help. Any help would be greatly
appreciated!
Thanks,
Eric
--
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
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/aa6cfbc0-2ae0-4b8c-b309-c131ba7cd01f%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/aa6cfbc0-2ae0-4b8c-b309-c131ba7cd01f%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/5c6727f5.1c69fb81.c9a50.5998SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/d/optout.