snipt

Ctrl+h for KB shortcuts

Bash

Expand a symlink

ruby -e 'puts File.expand_path(File.readlink(ARGV.first), File.dirname(ARGV.first))' -- /tmp
https://snipt.net/embed/9052e3a2b805d38ebf716aab47bc7f4e/
/raw/9052e3a2b805d38ebf716aab47bc7f4e/
9052e3a2b805d38ebf716aab47bc7f4e
bash
Bash
1
2019-08-17T20:42:53
True
False
False
Jan 03, 2013 at 11:31 PM
/api/public/snipt/52745/
expand-a-symlink
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>ruby -e <span class="s1">&#39;puts File.expand_path(File.readlink(ARGV.first), File.dirname(ARGV.first))&#39;</span> -- /tmp </span></pre></div> </td></tr></table>