Variable expansion in substitution

I have small script and I struggle with how variables expansion works.

for repo_data_path in $  {PROJECTS_HOME}/**/.git(e:'[[ ! $  REPLY =~ ".*local-hound/data/vcs.*"  ]]':) ; do   repo_path=($  {repo_data_path:h})   cat << REPOSITEM         "$  {repo_path:t}" : {             "url" : "file://$  {repo_path:s_/Users/mailo/Projects/my_/projects_}"         }, REPOSITEM done 

The script is provided with variable PROJECTS_HOME. Let’s say this variable contains /Users/mailo/Projects/my.

I do use this variable at the beginning and it works. I just don’t know how to make it expanding in the substitution, where I currently use hardcoded path — $ {repo_path:s_/Users/mailo/Projects/my_/projects_}.

sed variable expansion not working (unterminated `s’ command)

I have a file named config.yaml that contains this line:

device_connection_string: "<ADD DEVICE CONNECTION STRING HERE>" 

I want to replace <ADD DEVICE CONNECTION STRING HERE> with the value of the following variable:

root@ubuntu1804-ko-001:/tmp# echo "$  CSTRING";DeviceId=ubuntu1804-ko-001;SharedAccessKey=xdWDu2gnzlg8X1mHgGqYU+yECBYUJ065n1AjdkYNCWI= root@ubuntu1804-ko-001:/tmp# 

When I run this sed command, I get the unterminated s error:

sed -i "s/<ADD DEVICE CONNECTION STRING HERE>/$  CSTRING/g" config.yaml sed: -e expression #1, char 38: unterminated `s' command 

Thank you for your help!

the sims 4 expansion packs

Press the "Download Now" button to download the sims 4 expansion packs installer.
The whole process will just take a few moments.



– Title: the sims 4 expansion packs
– Download type: safety (no…

the sims 4 expansion packs

bash shell script, searching for complex line in makefile (shell parameter expansion issue)

I have an annoying problem, I want a script to search through a makefile (using grep) for a particular annoying line. The problem is best illustrated concretely:

someMakefile (minimal Makefile):

#!/usr/bin/env bash echo bla bla OBJ_DIR='something' EXE_FILE='my_exe' cp $  (OBJ_DIR)/$  (EXE_FILE) ../bin/. echo 'doing something else now' (test for the existence of the difficult line):


#!/usr/bin/env bash set -x foundNumLines = $  (grep -in 'cp $  (OBJ_DIR)/$  (EXE_FILE) ../bin/.' someMakefile) echo "foundNumLines = $  foundNumLines" set +x 

From the commandline (this DOES work):

$   grep -in 'cp $  (OBJ_DIR)/$  (EXE_FILE) ../bin/.' someMakefile 5:cp $  (OBJ_DIR)/$  (EXE_FILE) ../bin/. 

From the script (this does NOT work and I cannot figure out how to make it work):

$   ./  ++ grep -in 'cp $  (OBJ_DIR)/$  (EXE_FILE) ../bin/.' someMakefile + foundNumLines = 5:cp '$  (OBJ_DIR)/$  (EXE_FILE)' ../bin/. ./ line 4: foundNumLines: command not found + echo 'foundNumLines = ' foundNumLines =  + set +x 

When “grep” works from the script, I wanted to use maybe “wc” or similar, to detect the presence of the line and then do something, based on this…

I just cannot make it work, tried many combinations of “‘” \’ etc – I hope you understand, what I’m trying to achieve, please help with ideas/suggestions, thanks!

Is a Duergar’s Expansion and Invisibility abilities spell-like or psi-like? And does it matter?

The Duergar in the Monster Manual says that their expansion and invisibility abilities are spell-like abilities. But in the Expanded Psionics Handbook they are psi-like abilities.

Which is it? And does it matter? For example, if there was an area effect spell that prevented spell-like abilities, would it effect a duergar’s abilities (assuming they were psi-like)?

RAW answers please (I can’t find the tag on my phone).

Array expansion with offset

I’m building a spreadsheet that shows bonuses granted to an employee that vest and pay out spread over the following three years.

Easier just to see the example:

In the first sheet, I have it working ok, but for every new year I have to manually place the {x/3, x/3, x/3} array formula into the correct year that vesting should start.

I want it work like the second sheet, where I just add new data to the green section, and the 3 payouts appear starting in the following year. In column C, I’ve calculated the offset where payout should begin. I just need a way for the array formula to start expansion at that offset.

Note that sometimes there’s more than one grant per year, if that matters.

Is this a correct Laurent series expansion for the given annulus?

Expand the function $ $ f(z) = \frac{1}{(z + 1)(z + 3)}$ $ in a Laurent series valid for $ 1 < |z| < 3$

My attempt:

$ $ \frac{1}{(z + 1)(z + 3)}=\frac{1}{4}.\frac{1}{1+z}-\frac{1}{4}.\frac{1}{3+z}$ $

$ $ =\frac{1}{4}.\frac{1}{1-(-z)}-\frac{1}{4}.\frac{1}{3-(-z)}$ $

$ $ =\frac{1}{4}.\frac{1}{z}\frac{1}{\frac{1}{z}-(-1)}-\frac{1}{4}.\frac{1}{3-(-z)}$ $

$ $ =\frac{1}{4}.\frac{1}{z}\frac{1}{1-(-\frac{1}{z})}-\frac{1}{4}.\frac{1}{3}.\frac{1}{1-(-\frac{z}{3})}$ $

and now both fraction can be expanded using the geometric series

$ $ =\frac{1}{4}.\frac{1}{z}(1-\frac{1}{z}+\frac{1}{z^2}…)-\frac{1}{12}.(1-\frac{z}{3}+\frac{z^2}{3^2}…)$ $

Is the expansion correct?

NOTE: What is written above is the entire question.

Expansion of a product of two q-pochhammer terms

For $ n$ an integer and $ k$ an integer > 0, with $ |q| < 1$ a real number, consider the product $ A B$ where $ A = (q^n; q^2)_k$ and $ B = (-q^{n+1}; q^2)_k$ . That is,

$ $ AB = (q^n; q^2)_k (-q^{n+1}; q^2)_k = (q^n, -q^{n+1}; q^2)_k \tag{1}\label{eq1}. $ $

Here $ (a; q)_n = \prod_{k=0}^{n – 1} (1 – a q^{k})$ is the q-pochhammer symbol.

Is there a nice formula to expand $ \eqref{eq1}$ beyond simply applying the q-binomial theorem, $ (a; q)_n = \sum_{k=0}^n (-1)^k q^\binom{k}{2} a^k {n \brack k}_q $ , to either one of the terms $ A$ or $ B$ ?

Note that I’m trying to prove an expansion formula for $ A B $ with a particular value of $ |q| < 1$ in mind. So far I’ve made no headway using the q-binomial theorem alone (even when attempting some further elementary transformations using identities from the appendix of Gasper & Rahman).

Any reference suggestions would also be helpful.