variable-subsitution

Substitution Encryption/Decryption in R

狂风中的少年 提交于 2021-01-28 01:57:01
问题 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 this cipher key <- "ZGYHXIWJVKULTMSARBQCPDOENF" key <- unlist(strsplit(key,"")) and an Alphabet vector for the key alpha <- "ABCDEFGHIJKLMNOPQRSTUVWXYZ" alpha <= toupper(alpha) alpha <- unlist(strsplit(alpha,"")) Now my goal is to try to replace all

KeyVault --> Azure Pipeline --> XML variable substitution adds extra single quote to the end which breaks the connection string

落爺英雄遲暮 提交于 2020-05-17 07:46:13
问题 I asked previously how to do variable substitution with Azure KeyVault here, and was able to get it mostly working save one last issue. For some unknown reason, the substitution occurs perfectly but it adds one extra single quote at the end. Since these are connection strings in the web.config, that extra single quote breaks it. I have no idea what is adding that extra single quote. I did quadruple check KeyVault to ensure its not there as a typo. I have tried doing XML variable substitution

Azure Devops Release Pipeline XML Variable Substitution not working

℡╲_俬逩灬. 提交于 2020-03-23 02:03:25
问题 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: <?xml version="1.0"?> <connectionStrings> <add name="ExpenseDBConnectionString" connectionString="__ProdConnString__" providerName="System.Data.SqlClient" /> </connectionStrings> I then have the variable defined in the release pipeline: I also have the XML Variable Substitution enabled in the Deploy Task: But I run the release, and the

Bash Command Substitution with Variables

痞子三分冷 提交于 2019-12-08 06:13:06
问题 I have a bash script that builds a command based on a list of files so the command is built on the fly. Building it on the fly means it gets stored in a variable. I then want to run that command and store the output in a separate variable. When I use command substitution to try and run the command, it craps out. How can I get command substitution to work with a command in a variable when that variable utilizes pipes? Here is my script: # Finds number of files that are over 365 days old

Using sed in bash script to replace LaTeX aliases

青春壹個敷衍的年華 提交于 2019-12-06 04:44:32
问题 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 to isolate both the shortcut and the long-form in separate variables and then try to replace them in the text by using sed. I've attached short example files below. As it is currently the script takes 2 arguments, a file expr from which it

Using sed in bash script to replace LaTeX aliases

*爱你&永不变心* 提交于 2019-12-04 09:13:53
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 to isolate both the shortcut and the long-form in separate variables and then try to replace them in the text by using sed. I've attached short example files below. As it is currently the script takes 2 arguments, a file expr from which it retrieves the shortcuts and long-form terminology and an infile to which is is supposed to make the appropriate

Bash colon operator in variable substitution? [duplicate]

独自空忆成欢 提交于 2019-11-30 04:26:43
This question already has an answer here: Usage of :- (colon dash) in bash 2 answers 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 a string, -HEAD in this case, does not make any sense. This takes the variable branch_name , if it is defined. If it is not defined, use HEAD instead. See Shell Parameter Expansion for details: 3.5.3 Shell Parameter Expansion The ‘$’ character introduces parameter

Bash colon operator in variable substitution? [duplicate]

痴心易碎 提交于 2019-11-29 01:44:42
问题 This question already has an answer here: Usage of :- (colon dash) in bash 2 answers 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 a string, -HEAD in this case, does not make any sense. 回答1: This takes the variable branch_name , if it is defined. If it is not defined, use HEAD instead. See