unable to set variable in case statement bash

后端 未结 1 693
说谎
说谎 2021-01-18 07:16

I\'m trying to set a variable based on a bunch of input conditions. Here\'s a small sample of the code:

#!/bin/bash
INSTANCE_SIZE=\"\"
case \"$1\" in
   \"m         


        
相关标签:
1条回答
  • 2021-01-18 08:04

    You need to remove the $ sign in the assignments - INSTANCE_SIZE="m1.small". With the dollar sign, $INSTANCE_SIZE gets substituted with its value and no assignment takes place - bash rather tries to execute the command that resulted from the interpolation.

    0 讨论(0)
提交回复
热议问题