title: how to declare variable name with "-" char (dash ) in linux bash script
body: <p>I wrote simple script as follow</p>
  
  <pre><code>#!/bin/bash
  
  auth_type=""
  
  SM_Read-only="Yes"
  SM_write-only="No"
  
  echo -e  ${SM_Read-only}
  echo -e  ${SM_Write-only}
  
  if [ "${SM_Read-only}" == "Yes" ] &amp;&amp; [ "${SM_Write-only}" == "Yes" ] 
  then
      auth_type="Read Write"
  else
      auth_type="Read"
  fi
  
  echo -e $auth_type
  </code></pre>
  
  <p>And when i execute it i got following output with errors.</p>
  
  <pre><code>./script.bash: line 5: SM_Read-only=Yes: command not found
  ./script.bash: line 6: SM_write-only=No: command not found
  only
  only
  Read
  </code></pre>
  
  <p>Any one know correct way to declare the variable with "-" (dash)?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>have getting response from c code and evaluate the variables for example</p>
  
  <pre><code>RESP=`getValue SM_ Read-only ,Write-only 2&gt;${ERR_DEV}`
  RC=$?
  eval "$RESP"
  </code></pre>
  
  <p>from above scripts code my c binary <code>getValue</code> know that script want <code>Read-only</code> and <code>Write-only</code> and return value to script.So during <code>eval $RESP</code> in cause error and in my script i access variable by</p>
  
  <pre><code>echo -e  ${SM_Read-only}
  echo -e  ${SM_Write-only}
  </code></pre>
  
  <p>which also cause error.</p>