Welcome To Snipplr


Everyone's Recent Bash Snippets Tagged path



« Prev 1 Next »
  1. FAV

    Ensure string ends with a /

    Bash 11 views posted 5 years ago by jlmarks
  2. FAV

    Relative to Absolute Path Conversion

    the os x version of realpath works differently than the linux version; the following allows you to attain the same functionality in a shell on os x as `readlink -f $0` on a standard linux dist.
    Bash 14 views posted 9 years ago by iloveitaly
  3. FAV

    Find Your Ruby Gems Path

    Because different systems put it in different places.
    Bash 5 views posted 9 years ago by alvarezrilla
  4. FAV

    Creating links in different directories (Linux/UNIX)

    When using `ln` to create a link in a different directory, the semantics of creating hard and symbolic links differ. That is because a hard link contains a direct reference to its target's data, while a symbolic link is just a string containing a (p...
    Bash saved by 5 people 7 views posted 10 years ago by deepsoul
  5. FAV

    Canonical absolute path

    The following shell function returns the canonicalised abolute path of a file. It resolves symbolic links, /./ and /../ as applicable. This was adapted from various sources. Related snippets on snipplr are [Find absolute path of Bash script](http:...
    Bash 5 views posted 10 years ago by deepsoul
  6. FAV

    Find absolute path of Bash script

    Gets the absolute path of the script itself even when it's executing, not just a simple "pwd".
    Bash saved by 2 people 6 views posted 10 years ago by loungerdork
  7. FAV

    Set Linux environment variables JAVA_HOME & PATH globally using /etc/profile

    Bash saved by 3 people 10 views posted 10 years ago by cbrant
  8. FAV

    Determine if a path is in an nfs mount

    This is useful if you have some optional functionality being done which is quite slow on nfs. For example, I have a script that adds scm (svn/git/etc) info to my prompt, but I wouldn't want that when I'm in a repository on an nfs mount.
    Bash 11 views posted 11 years ago by kergoth
  9. FAV

    Add paths to Ruby 'require'

    Suppose you created a script chart.rb in /home/foo/ruby/mylib direcory. Now, you want to use this in the app.rb located in /home/foo/ruby/scripts. In ~/.bash_profile:
    Bash 3 views posted 11 years ago by cczona
« Prev 1 Next »