Change Directory

Hi All,

There is a code like below in my script

###############################################
###Create Directories and Sub-Directories
###############################################

dpdir=DP_FROM_${from}_TO_${to}
mkdir $dpdir
cd $dpdir
mkdir AWQM WFCONTROLLER PROVCO PRISM

####################################################
###Datapump --- Export and Import of Schema Objects
####################################################
cd $dpdir/AWQM

Its ( cd $dpdir/AWQM) giving error No such file or directory. I can assign "pwd" to variable and then change directory will work i believe. Is there any other way i can achieve this without assign any directory path?. Please suggest.

Thanks,
Mani

The 1st cd marked in red above already moved the script into the directory named by the expansion of the dpdir shell variable. The 2nd cd marked in red above will work if and only if dpdir expands to an absolute pathname. But, the definition of dpdir in this script is a relative pathname.

If you change the 2nd cd to just:

cd AWQM

it should get you to where I would guess it was trying to go.