title: How to create a script in Linux that makes a pyramid of asterisks with the pattern 1, 3, 5, 7, 9, 11, 13, 15, 17 centered
body: <p>I'm trying to write a shell script to print a pyramid of asterisks like this:</p>
  
  <pre><code>        *
         ***
        *****
       *******
      *********
     ***********
    *************
   ***************
  *****************
  </code></pre>
  
  <p>Below is my attempt so far. When I run it, I get some errors that say arithmetic expression required. What am I doing wrong?</p>
  
  <pre><code>for (( i = 1; i &lt;= n, i++ )); do
      for (( k = i; k &lt;= n, k++ )); do
          echo -ne " "
      done
  
      for (( j = 1; j &lt;= 2 * i - 1, j++ )); do
          echo -ne "*"
      done
  
      echo
  done
  </code></pre>