I have a config.properties file which contains a path like ouputdir=/data1/testdata/output
. I am able to extract these in shell and store this path in a variable. While I am trying to change directory to this path, I am getting error something like: No such file or directory/data1/testdata/output
, thouth this path exists.
What I tried is:
configPath=/data1/testdata.config.properties
my_value=$(grep outputdir $configPath| awk -F= '{print $2}')
echo $my_value
cd $my_value
by this I am able to print the path in my_value variable.but I am not able to change directory to $my_value.can anybody tell me what is wrong here and how can I change directory to this variable.