Welcome To Snipplr


Everyone's Recent Bash Snippets Tagged path



« Prev 1 Next »
0 778 posted 9 years ago by jlmarks
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 764 posted 13 years ago by iloveitaly
Because different systems put it in different places.
0 424 posted 14 years ago by alvarezrilla
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 629 posted 14 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 505 posted 14 years ago by deepsoul
Gets the absolute path of the script itself even when it's executing, not just a simple "pwd".
1 693 posted 14 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 649 posted 15 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 517 posted 15 years ago by cczona
« Prev 1 Next »