Hi everyone,
well I am using Linux some years, but since I built a LFS, I feel noobish again. Now with the help of BLFS I am setting up my environment and somewhere I incidentally read, that not every variable is inherited by a child Bash shell.
I have searched stackexchange and other website for the difference.
It is said that environment variable is inherited in child processes but shell variables are not. However the following test shows shell variables are seen in child process just as environment variables. Any suggestion please?
It is said that environment variables are inherited in child processes but shell variables are not. However the following test shows shell variables are seen in child process just as environment variables.
I need to set an environment variable called "64bit" (i.e. with a leading digit) in bash. However, bash variable names disallow a variable with a leading digit. I know a way to set it when invoking bash:
env 64bit=1 /usr/bin/bash
However, I'm looking for a way to change it in the currently running shell i.e. not by starting a new shell.
From tcsh, if I try:
exec /home/path/to/my/zsh
it works (I enter a Zsh shell)
but if I try
exec -c /home/path/to/my/zsh
I get:
-c Command not found
How do I switch to my Zsh shell and start it from a "blank slate"? (i.e. with no environment variables carried over from tcsh ).
Just to clarify: I know we can set environment variables with export command like
export JAVA_HOME=/usr/lib/jvm/..
For environment variables, we need to use '$' sign in starting and we can not explore the path further using 'tab' key.
I have OSX 10.8.2 with ZSH as my shell and iTerm as a terminal (don't know if the last thing is relevant).
From the lfs doc:
The exec env -i.../bin/bash command in the .bash_profile replaces
the running shell with a new one with a completely empty
environment, except for the HOME, TERM, and PS1 variables. This
ensures that no unwanted and potentially hazardous environment
variables from the host system leak into the build environment.
I encountered a strange issue this morning. My $PATH environment variable is screwed up by a command
export PATH=./releases/bin:$PATH
It is totally okay to run this under a existing shell, the issue is I put it in the shell startup shell script .profile.