I have a request from a programmer to set an env variable for him. I know how to do it for bash shell by adding the following line to .bash_profile
But this will be applicable only when he is in his bash shell. What is the procedure to be followed to make this env varibale applicable irrespective of the shell the programmer use.
Most of the time, User may himself set these kind if variables since they have access to at least their $HOME.
All the shell related profiles ( ,bashrc, .kshrc etc ) are resides in the $HOME of the user.
Even if you have the request for whatever the reason, you can make an entry in the above files (or you may ask user which shell is going to be used).
You can also check the user's default shell in /etc/passwd file against the appropriate user id.
If you want to set the variable to all users and all shell you will have to make an entry in /etc/profile file. which is generally not recommended until its truly necessary.
also, setting the variable and then "exporting" is always a good practice.
i set a variable from the command line:
export GANG="james,roy,martin"
i can access this variable ($GANG) from a script. but each time i run the script, the variable keeps getting bigger. more info keeps getting added to it.
Is there anyway i can make the $GANG variable contain the... (3 Replies)
i want to set environmental variables in solaris and redhat.
it should show the current directory and the default shell should be bourne shell. along with it should show the hostname..
like this
hostname{/home/vipin/data}# ifconfig
Thanks in advanced.:wall:
Please use code tags.... (1 Reply)
Hola -
I've got a script for logon which populates a database with some info when a user logs on so that we can tell how many public terminals are in use & show users which ones are free. However, the machines are DHCPed and so using $HOSTNAME gives me an unstable name for them since of course... (3 Replies)
Hi,
I have Sun solaris x64 box in which i need to set a Environment variable for all the users in the box. This Environment varible is used by the application on the box.
Could any one please help me in setting the Environment variable.
Thanks,
Firestar (6 Replies)
Dear Folks,
I am facing an issue in getting a value of a variable.Let me explain the scenario.
I am having a list file say files.list in which I have mentioned
1 FILE1
2 FILE2
Then I am having an set_env.ksh in which I mentioned
FILE1=/clocal/data/user/userdata.txt... (4 Replies)
Hello.
I have a question about how the PATH environment variable works.
I wrote a script in $HOME/bin/gvim.
I want it to be called instead of /usr/bin/gvim,
so I've placed it before in the PATH.
However, it is still the old one that is found.
If I open an other terminal, I have the... (6 Replies)
Hi,
I have problem setting up environmental variables.
The idea is to start with main.ksh script that will run setting.ksh, and in side of it I'll set up variables.
Please take a look at my code, and help me to find my mistake.
Thanks,
Mila
Main.ksh look like this:
#!/usr/bin/ksh
#... (2 Replies)
Hi,
I'm exporting an environmental variable from a C program using putenv function. I'm calling the exe of the C program from shell script. But when I display the environmental variables from the Shell script, My varaible is not getting displayed.
Can anyone please tell me how to get it in... (2 Replies)
Can someone send me a shell script to set all Oracle environment variable which is working.
I have the following script which works but not 100%. Please advice what you think is wrong.
if # Command executed from a terminal
then
ORACLE_SID=""
... (4 Replies)