problem switching to directory using shell script

Hi,

I have an issue with switching to other directory through shell script. I have used

 cd /Music"  

but that doesn't help me. Then I have also tried using

alias proj 'Music'
alias

then I get the error permission denied but i set the chmod 777 Music. I am using cShell for my scripting. I also tried export proj=Music but not use. can any one please help me with this issue.

Thank You,

Baluk

source script

I suppose it depends what the cd in the script is for. If it is intended that this sets up the user environment and leaves them (or the calling script) in the correct directory, then you will need to call it in to overwrite your current environment. For many shells (sh, bash, ksh, etc.) this is done as follows:-

. my_environemt_script

For a csh call, it is:

source my_environment_script

You are correct that you need the execute permission on a directory to cd to it, so if I have missed the point, please let me know.

Robin
Liverpool/Blackburn
UK

P.S. You don't have any 3rd party security software installed do you? Some of the very good ones will manage file/directory access as though they were assets to be protected. You would need a specific rule to allow you to do this. Can you supply the simplest example with the error and an ls -ld of the directory?

Thanks,
Robin

When you are in the directory called Music , please post the output from the unix command "pwd" to display the tree to the current directory:

pwd

Please then do the same for the directory containing the script and we should be able to work out how to get from one directory to the other.

Btw. If "Music" is just subdirectory, did you try:

cd Music