vscode-bash-debug icon indicating copy to clipboard operation
vscode-bash-debug copied to clipboard

How to change script variable value

Open jmcpheters opened this issue 3 months ago • 0 comments

I'm using VScode (1.105.1) with bash debug and remote SSH extensions to walk through bash scripts on an AL2023 EC2 instance. The bash version on AL2023 is 5.2.15, so I installed bashdb from https://sourceforge.net/projects/bashdb/files/bashdb/5.2-1.2.0/bashdb-5.2-1.2.0.tar.gz . I've been able to step through scripts and examine variables, but I cannot figure out how to overwrite a variable in the bash script being stepped through.

My search results indicate I should just be able to type the bash expression in the input line for the Debug Console, or maybe put eval in front. All attempts to overwrite a variable value results in the variable being set to the empty string. In the screenshot below, the INPUT variable was initially read in as 'input-str'. I then try to overwrite the value with 'new-str', which does not succeed.

How can I overwrite a variable in the bash script being debugged?

Image

jmcpheters avatar Oct 17 '25 22:10 jmcpheters