File Name Handling in bash: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 4: Line 4:


=Absolute Path for a File=
=Absolute Path for a File=
<syntaxhighlight lang="bash">
local dir=$(cd $(dirname $0)/..; pwd)
basename ${dir}
</syntaxhighlight>

Revision as of 23:38, 11 May 2018

Internal

Absolute Path for a File

local dir=$(cd $(dirname $0)/..; pwd)
basename ${dir}