in reply to Re: getting a problem when I use which command with system function
in thread getting a problem when I use which command with system function

thanks a lot sgifford.
#setenv MACH `machtype`
found in $HOME/.cshrc. I commented this line. after that I got the expected behaviour from my perlscript.
  • Comment on Re^2: getting a problem when I use which command with system function
  • Download Code

Replies are listed 'Best First'.
Re^3: getting a problem when I use which command with system function
by jhourcle (Prior) on Nov 03, 2006 at 16:23 UTC

    I actually ran into a problem with 'which' and a '.cshrc' file a week or two ago when doing some shell scripting on MacOS X

    In my case, it was much more subtle, as which was written in csh, but that wasn't the shell I was using. So when it called the .cshrc, it overwrote PATH, and would report programs that weren't in my path when I was using bash.

    (of course, which is a builtin under csh, so the odds of you calling the script under csh in normal use should be non-existant)

    Oddly enough, there's a note about 'DO NOT USE "csh -f"' immediately after the shebang line, which fixes the problem, but I have no idea what other implications it might have.