Executing a change directoru command through a script

Post Reply
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

Executing a change directoru command through a script

Post by gaurav.shetti »

Hi,
This is what I am doin inside my script:

<$loc_db="/libraries/mnt/searchfiler/db/ldb">

<exec cd $loc_db></exec>

But the directory does not get changed.

Regards,
Gaurav
User avatar
mark
Site Admin
Posts: 5513
Joined: Tue Apr 25, 2000 6:56 pm

Executing a change directoru command through a script

Post by mark »

Unix 101: Changing the current directory in a child program will not affect the parent. "cd" works on the command line because it's built into the shell.

You need to use the built-in cd command of vortex.
<syscp cd $loc_db>
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

Executing a change directoru command through a script

Post by gaurav.shetti »

thanks :)
Post Reply