title: How to change the value of a function's parameter in linux script?
body: <p>I have a script which I call with different parameters. Depending on the value of those parameters I check out and build the 'parameter' SVN version of the project.</p>
  
  <pre><code>./deploy 3281 
  </code></pre>
  
  <p>This command will create a 3281 directory and check out the 3281 SVN version of the project and will build it in the 3281 directory.</p>
  
  <p>I need to  create a key word 'HEAD' so the script will check to see the latest SVN revision number and create a folder for it (ex: 3282 ) and then checkout the head version of the project and build it there.</p>
  
  <p>I find out how to get the latest revision number with svn ( svn info -r 'HEAD' --username jse <a href="http://jse@svn.ctsvpn.com/repos/Teleena/" rel="nofollow">http://jse@svn.ctsvpn.com/repos/Teleena/</a> | grep Revision | egrep -o "[0-9]+" ) and I am trying to simply implement an if like this:</p>
  
  <pre><code> #check to see if latest/head revision is called
          if [ "$1" == "head" ]; then
                  #get latest revision number
                  HEADREV=$(svn info -r 'HEAD' --username jse http://jse@svn.ctsvpn.com/repos/Teleena/ | grep Revision | egrep -o "[0-9]+")
                  echo "=========================================="
                  echo "= Revision number: $HEADREV will be used ="
                  echo "=========================================="
                  #change swap the second parameter
                  $1=$HEADREV  #&lt;-- IS THIS CORRECT?
          fi
  ...[rest of program here]
  </code></pre>
  
  <p>I want to replace the first parameter with the latest revision number and leave the rest of the script untouched. So the question is: How to I change a function's parameter value from inside the function?</p>