I want to pass variable named $linewithoutquotes to another method called b(), which is called from updateEnvironmentField() method. How to do the above requirement with shell script
First: you definitely shouldn't use backticks any more and the use of echo ... | tr ... is overly complicated. You can do:
linewithoutquotes="${LINE//\"/}"
To pass it to another function pass it as an argument:
b ()
{
passedline="$1"
echo "inside b(), passed line is: $passedline"
}
updateEnvironmentField()
{
linewithoutquotes="${LINE//\"/}"
b "$linewithoutquotes"
}