title: use commandline arguments in bash aliases
body: <p>I am new to linux and trying to create an alias that starts mongodb service.
  The original command is <code>sudo service mongod start</code>. I want to generalise this usage for any service. </p>
  
  <p>i.e. something like <code>alias startservice="echo &lt;password&gt; | sudo -S $1 start"</code>.</p>
  
  <p>So I would call it like <code>startservice mongod</code> should run the first command. I came to know that I can use functions for the same. However, I don't have a clue on how to do this either way. </p>
  
  <p>Because I want my function which I create to be able to be accessible across terminals. I am not sure on how to create functions that act in this manner. Please help me on this.</p>
  
  <p>I have gone through these two links:</p>
  
  <p><a href="https://stackoverflow.com/questions/4644653/parameter-subsitution-in-bash-aliases">parameter subsitution in bash aliases</a></p>
  
  <p><a href="https://stackoverflow.com/questions/41867863/alias-with-argument-in-bash-mac">Alias with Argument in Bash - Mac</a></p>
  
  <p>Your help would be appreciated.</p>