-
Bug
-
Resolution: Not A Defect
-
Blocker
Here is my shell script:
echo ${BUILD_NUMBER};
echo ${SERVER};
sed -e 's/NSString *SERVER = @"[A-Z0-9]*";/NSString *SERVER = @"${SERVER}";/g'
Here is the output when the build runs. Notice the second ${SERVER} is not replaced.
+ echo 98
98
+ echo CI1
CI1
+ sed -e 's/NSString *SERVER = @"[A-Z0-9]*";/NSString *SERVER = @"${SERVER}";/g'
[JENKINS-13784] Environment Variables do not replace in shell scripts
Resolution | New: Not A Defect [ 7 ] | |
Status | Original: Open [ 1 ] | New: Closed [ 6 ] |
Workflow | Original: JNJira [ 144251 ] | New: JNJira + In-Review [ 205858 ] |
The title of the issue is somewhat misleading. The environment variables are being replaced as evidenced by the echo statements. The problem appears to be with the sed command. I copied it and attempted to run it from the command line but it doesn't complete. If it won't complete from the command line then I wouldn't expect it to run when put in a shell script.