title: linux source a symbolic link
body: <p>I have a bash script which i want to call from any directory, but i don't want to add the directory it is in to PATH as it is filled with lots of other scripts which will just clutter.</p>
  
  <p>The script in question manipulates environment variables, so i have to source it.
  I tried creating an alias</p>
  
  <pre><code>alias  aliastoscript="/path/to/script" 
  source aliastoscript #This does not work says no such file
  </code></pre>
  
  <p>I also can't copy the script itself to a different location as it depends on the directory structure and other scripts in the directory.</p>
  
  <p>So i tried a symlink to a location already in path:</p>
  
  <pre><code>ln -s /path/to/script /directory/already/in/path/myscript
  </code></pre>
  
  <p>But this does not work either:</p>
  
  <pre><code>source myscript #says no such file exists
  </code></pre>
  
  <p>Can anyone suggest how i achieve this? And why does the symlink approach not work?</p>
  
  <p>If it makes any difference, i am using a zsh shell on ubuntu 14.04</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The answer given below works, but i also wanted to know why the symlink approach was not working.
  Here is the sequence of commands</p>
  
  <pre><code>ln -s /path/to/script /directory/already/in/path/myscript
  #Now there is a symlink called myscript in a directory which is in PATH
  
  source myscript arg1 #This throws an error saying no such file myscript,    
  #but it is not supposed to happen because myscript resides in a directory which is in PATH
  </code></pre>
  
  <p><strong>EDIT 2:</strong>
  I just figured what i was doing wrong, the symlink i created, i had used relative paths, totally stupid of me, using absolute paths it worked like a charm.</p>