title: Modifying a parameter pass to a script (Bash)
body: <p>I have been looking on Google for quite a while now and can't find anything that is matching what I need/want to do.</p>
  
  <p>My objective is to write a script that takes two arguments. It will search through the first argument (which is a list) and detect if the second argument is already in it. For example:</p>
  
  <p>list = /bin/foo:/bin/random:random</p>
  
  <p>to add to list: /bin/foobar</p>
  
  <p>Calling the script will produce the result of /bin/foo:/bin/random:random:/bin/foobar.</p>
  
  <p>If the part to add to the list is already in the list then nothing will be changed of the original.</p>
  
  <p>I have everything working up until the point where I want to modify the parameter I passed.</p>
  
  <pre><code>...
  if [ $RUN = 1 ]; then
      echo $1
  else
      $1="$NEWLIST"
  fi
  exit 0
  </code></pre>
  
  <p>This however produced an error. It says that the command isn't found and gives me the line number that $1="$NEWLIST" is on. What am I doing wrong here? How do I modify $1? Thanks!</p>
  
  <p>edit:</p>
  
  <pre><code>$ PATH=/opt/bin:$PATH
  $ ./scrip.sh PATH /user/opt/bin
  $ /opt/bin:/user/opt/bin
  </code></pre>
  
  <p>This is what I would want as a result of the script.</p>