It prints the value, but also tries to run it as a command. "printenv VARNAME" works much better, and is preferable to "echo VARNAME" for environment variables, because you can overwrite VARNAME with a shell variable:

% printenv PATH
/sw/share/Geomview/bin:/sw/bin:/sw/sbin:/Users/hansen/bin/powerpc- apple-darwin:/Users/hansen/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/ sbin:/usr/sbin:/sbin:/usr/X11R6/bin
% echo $PATH
/sw/share/Geomview/bin:/sw/bin:/sw/sbin:/Users/hansen/bin/powerpc- apple-darwin:/Users/hansen/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/ sbin:/usr/sbin:/sbin:/usr/X11R6/bin
% set PATH
% echo $PATH
% printenv PATH
/sw/share/Geomview/bin:/sw/bin:/sw/sbin:/Users/hansen/bin/powerpc- apple-darwin:/Users/hansen/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/ sbin:/usr/sbin:/sbin:/usr/X11R6/bin


On Tuesday, November 18, 2003, at 02:43 PM, Yoav Felberbaum wrote:

At 14:34 -0500 18/11/03, Alexander K. Hansen wrote:
Try using "printenv PATH" instead and see if "Command not found" is present.

Ah, that shows up fine now.


---
% printenv PATH
/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/ local/bin
---
So doing % $VARNAME at the command line isn't the "right" way of checking a variable?




On Tuesday, November 18, 2003, at 02:32 PM, Yoav Felberbaum wrote:


At 13:44 -0500 18/11/03, Alexander K. Hansen wrote:
No, that's normal: this syntax makes your shell try to run your PATH as a command.

Apologies for not being clearer.


I was referring to the "Command not found" which seems to be _in_ the $PATH variable. Should that be there in the first place?

On Tuesday, November 18, 2003, at 01:17 PM, Yoav Felberbaum wrote:

Wanted to do some tinkering with some programs I wrote, so decided to put it in my $PATH.

However, before I did that, I did $PATH & got this -
---
% $PATH
/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/ usr/local/bin: Command not found.
---


Investigating this a while ago, IIRC, there's a bug in init.csh which I found by stepping through. Sorry I can't be more specific as it was ages ago. If no-one has an immediate solution, then I'll dig out what I did exactly & let you know.

TIA!




--
Alexander K. Hansen
Levitated Dipole Experiment
http://www.psfc.mit.edu/LDX



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Fink-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to