|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| ARCHIVES - General Questions If your question doesn't fit in any other category below ask in here. |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I'm not sure where to post this, but I'm having trouble getting 10.2 and 10.3 tcsh to pick up environment variables - it doesn't seem to pick them up from a statement like:
> source somefile_with_setenv_statements_in_it inside the file I'm sourcing are things like: setenv PLATf Linux_AMD_G95 set vpath = /home/patti/V/Ver_6.0.2 But when I try to compile it reports: vpath: Undefined variable I'm wondering if it would help to set tcsh as the default shell for the whole system (rather than just me). I'm trying to compile some software that uses the tcsh syntax, and I think sometimes 10.2 uses the bash shell without asking. Where is the system-wide default shell set? Also, how can I check that tcsh is actually picking up the setenv's? (some command-line query?) Since I've never worked with tcsh before, I think there's something simple I might be doing wrong or else that SuSE's tcsh is not "standard." I've been tinkering and trying to find that something simple I'm not doing for a long time and hoping someone can help. PattiM |
|
|||
|
I am not a tcsh user (even not a csh one), but from other shells experience I may throw in some suggestions.
Shell variables are not normaly put into the environment of the process and thus not automaticaly inherited by sub-processes. In other shells you have to export them (perhaps tcsh does different): Code:
export VAR='par' Code:
VAR='par' export VAR Evry script should start with the shebang (it also has other names) so there can be no uncertainty about which interpreter to use: Code:
#!/bin/bash Code:
#!/usr/bin/tcsh |
|
|||
|
You can choose to use bash or tcsh or <some shell> in your terminals/consoles from the User setup in YaST.
The advice about the shebang when writing scripts is most important. I use tcsh as my command line shell, but I write my scripts in bash. In your shoes I'd use bash for everything - I use tcsh out of habits going back years. In tcsh, "setenv" will export automagically if you source the script. |
|
|||
|
Thanks for the replies - it suddenly started working. For some reason I had to reboot in order to get it to pick up environment variables. Maybe that's just an x86_64 thing, but invoking tcsh (in bash) didn't even read the .tcshrc file, now it is. So something was wrong... but now OK.
THANKS!!!!!!!! Patti
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|