0

I need some help with switch case statements in shell scripting. Here I am trying to read the Variable name and assign it to a switch case and based on the value of the switch case I want to assign a new name for the respective Variable name and pass it to other script.

name = "$(Release.TriggeringArtifact.Alias)";
case $name” in “_app1”) echo “appFIRST”;;
“_app2”) echo “appSECOND”;;
“_app3”) echo ”appTHIRD”;;
*)
Echo “default case”;;
esac

So here I want to assign the output to a variable and read it in the other script.

  • Please copy and paste the script **exactly** as it is. In your posted script, the first line and the `Echo` line should both produce an error message. Also, paste your script into [shellcheck](https://www.shellcheck.net/) before asking here. – user1934428 Nov 21 '22 at 08:40

0 Answers0