All Questions
Tagged with variable-substitution environment-variables
9 questions
0
votes
1
answer
94
views
Is there a tool that can print out a bash script with the variables substituted? [duplicate]
Say I have a bash script that takes some environment variables and parameters and substitutes those variables in a script.
Is there a tool that can show how the script with the substituted variables ...
1
vote
2
answers
794
views
bash var substitution inside json to use in curl
Team,
I am unable to substitute values inside json(myjson) to use in curl command. any hint?
JENKINS_USERNAME="svc-user"
JENKINS_USER_TOKEN="xxxx"
JENKINS_INSTANCE_FQDN="sham....
-3
votes
2
answers
1k
views
Bash Script - Expand ESCAPED dollar-sign ($) into its Variable
My Problem
I have this run.sh script:
#!/bin/bash
TODAY=$(date)
FILE="my_file.txt.\${TODAY}"
When I echo FILE I get this:
echo ${FILE}
Output: `my_file.txt.${TODAY}`
But I want this:
echo $...
0
votes
0
answers
16
views
assign to a number named variable to mimic command line argument [duplicate]
I have a script where I am passing commands to processes with an arguments passed from command line and from environment variables as well.
To simplify my use case lets assume my processes are echo ...
2
votes
2
answers
89
views
Using variable values defined in one file, in files in the same directory
In this GitHub repository I have a directory named nwsm. This directory contains the file nwsm.sh that contains a master script (a script that runs other scripts).
The directory also contains a few ...
3
votes
1
answer
645
views
Exim condition failure "${env is not a known operator"
I am trying to substitute a hard-coded path in my Exim configuration file with a value taken from an environment variable, however I am getting an error I do not understand.
"${env" is not a known ...
4
votes
1
answer
2k
views
Running a constructed command from bash script
I constructed a command like this in a bash script
a="my_cmd";
a="$a --verbose";
echo $a;
$a;
It works and executes my command correctly. But when I add an environment variable to the mix it breaks.
...
2
votes
1
answer
5k
views
bash: export: `--wait': not a valid identifier
When I run git-sh from my terminal it works fine. But I get the following warning.
bash: export: `--wait': not a valid identifier
What is this and how do I get rid of it?
0
votes
1
answer
170
views
Colon breaks the variable subsitution [closed]
I am trying to lookup some C functions so that I could debug while using strace. So I setup a bash function to look it up in firefox (or links), but the substitution falls apart with : and escaping ...