title: How to Set variables inside a Linux for loop
body: <p>I'm trying to determine the existing HDDs in each system using a for loop as show below, the problem is when I try to set the variable using the below code i get sda=true: command not found. What is the proper way to do this?</p>
  
  <pre><code>#!/bin/bash
  for i in a b c d e f
  do
      grep -q sd$i /proc/partitions
      if [ $? == 0 ]
      then
          sd$i=true
      else
          sd$i=false
      fi
  done
  </code></pre>