Welcome To Snipplr
Everyone's Recent Bash Snippets Tagged path
- All /
 - JavaScript /
 - HTML /
 - PHP /
 - CSS /
 - Ruby /
 - Objective C
 
 « Prev 1 Next »
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.
        
        
        
            0 
        
        
            1412 
        
                    posted 15 years ago by iloveitaly
            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...
        
        
        
            1 
        
        
            1541 
        
                    posted 16 years ago by deepsoul
            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:...
        
        
        
            0 
        
        
            1105 
        
                    posted 16 years ago by deepsoul
            Gets the absolute path of the script itself even when it's executing, not just a simple "pwd".
        
        
        
            1 
        
        
            1553 
        
                    posted 16 years ago by loungerdork
            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.
        
        
        
            0 
        
        
            1424 
        
                    posted 17 years ago by kergoth
            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:
        
        
        
            0 
        
        
            1102 
        
                    posted 17 years ago by cczona
             « Prev 1 Next »