Now the script looks like #!/bin/bash va=`cut -d"/" -f2 out` echo $va cd "$va" But didnot worked for me Kaushal
To be certain of the value of the variable va, use something like echo "===$va===" or some other benign character to delimit the output so you will know for certain that it's "sab" and not "sab " or " sab" where the space is some non-printable character (or an actual space). And also execute the command pwd (or ls) just before the cd command to see which directory the script is in when trying to do the cd command. You may not be at the correct path to be able to execute a relative cd command vs an absolute one. Jacques B.