-2

trying to change directory in csh script. But i am getting following error :

~/.setprompt: No such file or directory

permission of above file is like that :

-rwxrwxrwx 1 vgangwar 46 Oct 5 2015 /home/vgangwar/.setprompt

Undefined Behaviour
  • 729
  • 2
  • 8
  • 27
  • Please [edit] your question and add the script where you're calling `cd`, as well as your `.setprompt` script - `.setprompt` might try to call an external program that doesn't exist. – Frank Schmitt Feb 22 '17 at 08:19
  • @FrankSchmitt as these script files are internal files of my company. So i am not allowed to put code in public. But i got the answer. I am doing set noglob in the script which making the problem. this flag prevent wild card pattern matching. Thank you – Undefined Behaviour Feb 22 '17 at 10:05
  • The error message is certainly not a result from a `cd`, and `.setprompt` is, to the best of my knowledge, nothing which would have special meaning to csh. Either you have a `precmd` or a `postcmd` defined, or the error comes from a different part of your code. I suggest to run your script with `set echo`. – user1934428 Feb 22 '17 at 11:37
  • @Spartacus if you solved the problem, please post the solution and close the question. – user2141046 Mar 02 '17 at 14:25
  • @user2141046 Thanks for pointing me for posting the answer. – Undefined Behaviour Mar 03 '17 at 07:57

1 Answers1

0

In my script, somewhere i am doing set noglob which causing the problem.

noglob - When set prevent filename expansion with wildcard pattern matching

after it , i am trying to change the directory using cd command. That's why i am getting error which is shown in question. It is solved by unsetting the noglob (unset noglob) variable before changing the directory.

Undefined Behaviour
  • 729
  • 2
  • 8
  • 27