I would like to know why in order to get current directory from within a script we need to use solution such as:
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"taken from here.
Instead of something like:
DIR=$("pwd")Once I have current directory of current script, and I want to calculate its
parent's parent parentdirectory path, how do I do that? In terminal its simplycd ../../../, how this can be caluclated onDIRand assigned to a new variable?What is the difference in bash assignment between
NUM:=1andNUM=1
Cheers