title: How to create a function in shell script that receives parameters?
body: <p>I'm working on a shell script and I have some lines of code that are duplicated (copy pasted, let's say).</p>
  
  <p>I want those lines to be in a function. What is the proper syntax to use?</p>
  
  <p>And what changes shoud I do in order for those functions to receive parameters?</p>
  
  <p>Here goes an example.</p>
  
  <p>I need to turn this:</p>
  
  <pre><code>amount=1
  echo "The value is $amount"
  amount=2
  echo "The value is $amount"
  </code></pre>
  
  <p>Into something like this:</p>
  
  <pre><code>function display_value($amount) {
      echo "The value is $amount"
  }
  
  amount=1
  display_value($amount)
  amount=2
  display_value($amount)
  </code></pre>
  
  <p>It is just an example, but I think it's clear enough.</p>
  
  <p>Thanks in advance.</p>