Is there a tool that can print out a bash script with the variables substituted?
0
votes
1
answer
114
views
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 will look like?
Take this short script for instance.
echo user = $USER host = $HOSTNAME
The program would output
echo user = vfclists host = unixse
So the script would be along the lines of
expandscript script.sh --param1=xxxx --param2=xxxx --param3=xxxx
and in addition to the environment variables filling the values of the params where they are set to the programs variables.
Asked by vfclists
(7909 rep)
Dec 2, 2024, 09:35 PM
Last activity: Dec 3, 2024, 03:19 PM
Last activity: Dec 3, 2024, 03:19 PM