title: calling function from command line
body: <p>I have written a function that is working as expected within the shell script. But how do I call it from command prompt? I tried the alias command, but I get an error </p>
  
  <pre><code>bash: syntax error near unexpected token `)'
  </code></pre>
  
  <p>There is no such error when I type sh myscript.sh at command prompt.</p>
  
  <p>Here is the new error:</p>
  
  <pre><code># alias start_multi="start_multi () (for socket in {2..9} do; /usr/bin/mysqld_multi start $socket; done )"
  
  # start_multi
  bash: syntax error near unexpected token `/usr/bin/mysqld_multi'
  </code></pre>