Skip to main content

All 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 ...
vfclists's user avatar
  • 7,859
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....
AhmFM's user avatar
  • 135
-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 $...
Bog's user avatar
  • 1,124
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 ...
jangorecki's user avatar
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 ...
Arcticooling's user avatar
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 ...
Malvineous's user avatar
  • 7,335
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. ...
Jithin's user avatar
  • 143
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?
ShivamD's user avatar
  • 141
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 ...
Forethinker's user avatar
  • 1,409