Skip to content

How to change script variable value #201

@jmcpheters

Description

@jmcpheters

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions