Quantcast
Channel: How to obtain the absolute path of a file via Shell (BASH/ZSH/SH)? - Stack Overflow
Viewing all articles
Browse latest Browse all 46

Answer by Atika for How to obtain the absolute path of a file via Shell (BASH/ZSH/SH)?

$
0
0

An alternative to get the absolute path in Ruby:

realpath() {ruby -e "require 'Pathname'; puts Pathname.new('$1').realpath.to_s";}

Works with no arguments (current folder) and relative and absolute file or folder path as agument.


Viewing all articles
Browse latest Browse all 46

Trending Articles