Questions tagged [variable-substitution]

This tag is misspelled. variable-substitution is correct. `t` is missing. This is the process of evaluating a string literal containing one or more placeholders, yielding a result in which the placeholders are replaced with their corresponding values.

74 questions
156
votes
28 answers

Command copy exited with code 4 when building - Visual Studio restart solves it

Every now and then when I build my solution here (with 7 projects in it) I get the dreaded 'Command copy exited with code 4' error, in Visual Studio 2010 Premium ed. This is because of the post-build event not being able to go through. Here's what…
55
votes
3 answers

Bash colon operator in variable substitution?

I inherited some bash code and these two lines are bewildering me: branch_name=`git describe --contains --all HEAD` branch_name=${branch_name:-HEAD} My understanding of the : colon operator is that is creates a substring based on an index so using…
Gardner Bickford
  • 1,934
  • 1
  • 17
  • 25
10
votes
1 answer

When do you need curly braces for variable substitution in Gradle?

If you have variables defined in your gradle.properties file, when is it necessary to use curly braces for variable substitution (e.g., "some string ${yourVariable}") and when is it okay to do without (e.g., "some string $yourVariable"). Is it…
Michael Wu
  • 1,177
  • 1
  • 13
  • 34
8
votes
3 answers

Variable substitution in psql \copy

is possible in PSQL console export file with current date on the end of the file name? The name of the exported file should be like this table_20140710.csv is it possible to do this dynamically? - the format of the date can be different than the…
5
votes
2 answers

Azure Devops Release Pipeline XML Variable Substitution not working

I have a very simple variable substitution in my release pipeline, but it's not working. I have the variable in the connectionStrings.config file as such:
M.R.
  • 4,737
  • 3
  • 37
  • 81
4
votes
1 answer

Docker-compose variable-substitution mandatory variables

I have a docker-compose file that uses variable substitution for some secrets and I want to get an error if they are not supplied or empty, for this purpose I have tried this: environment: - >- JAVA_OPTS= …
4
votes
1 answer

Can I substitute Eclipse and Maven variables into a log4j.properties file?

You can use system properties in log4j configuration files using a ${variablename} syntax. Can you include Eclipse variables (like the project name) and Maven variables (like the artifact ID) in there too, and have them substituted during the…
brabster
  • 42,504
  • 27
  • 146
  • 186
4
votes
2 answers

How can I have Octopus do variable substitution during or after applying a configuration transform?

I'd like to reference variables I've defined in my deployment project (scoped to an environment) from my web.config.[environment] transform files. When I do, the variable references end up in the transformed web.config without being replaced.
Jim Lamb
  • 25,355
  • 6
  • 42
  • 48
4
votes
3 answers

Using sed in bash script to replace LaTeX aliases

I am relatively new to bash scripting and have no experience with LaTeX. I've been asked to develop a script which will replace convenience shortcuts in LaTeX documents with their more cumbersome long-form equivalents. My approach thus far has been…
3
votes
2 answers

Django variable substitution in the include template tag

I have an internationalized Django 1.3 site and want to do this: {% include "snippets/button.html" with button_text=_("Logout {{ user.username }} now") %} And snippets/button.html looks like this:
3
votes
3 answers

How to find the nth multiline block of text using sed

So I have a file which contains blocks that looks as follows: menuentry ... { .... .... } .... menuentry ... { .... .... } I need to look at the contents of each menu entry in a bash script. I have very limited experience with sed but through a…
WarBro
  • 305
  • 2
  • 10
3
votes
1 answer

Strategy for Octopus variable substitution in config.js that is webpacked in jenkins

I am working on an ES6 AngularJS project where I am using webpack to bundle everything into dist/app.js. The CI/CD stack I am working with is SCM - Jenkins - Octopus: Updates to my code are pushed to a repository Jenkins clones the repository,…
valorl
  • 1,499
  • 2
  • 14
  • 30
3
votes
2 answers

Variable substitution in a list in Tcl

I am trying to substitute a variable in a list: % set a 1 1 % set b {1 $a} 1 $a % % set a 1 1 % set b [list 1 $a] 1 1 When I use the curly braces {}, to define the list the variable 'a' doesn't get substituted with its value but…
skorada
  • 431
  • 1
  • 4
  • 15
2
votes
1 answer

Call a .NET method with part of the method name replaced by a variable

Here is a simple command that I would like to use a variable in. (Get-Date).AddDays(-30) What I'm trying to do is substitute a variable $Time for the word Days. $Time="Days" OR $Time="Hours" Then run something like this: (Get-Date).Add$Time(-30) Is…
2
votes
2 answers

Substitution Encryption/Decryption in R

Using the variables alpha and key, encrypt ptext into a variable named ctext. Using substitution cipher So I have a text file separated in a vector ptext <- strsplit(ptext,split = "", fixed = TRUE) ptext <- unlist(ptext) I also created a key for…
1
2 3 4 5