setting environment

I have certain environments which has to be set in certain user profiles,I have to do this by running a file which has these environments
Can somebody please let me know as how to create this particular file so that when i run this file it sets the environment of the user
Please let me know
One way i can say how can i create a batch file just like the dos batch file and howd do i run it on the unix environment
Thanks in advance
Arun
tummaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tummaAuthor Commented:
Edited text of question.
0
gunny051499Commented:
as i understand you, all you need is some environment variables set at login time, right?

to do this edit either the file ".login" or ".profile" (notice the dots at the beginning) in each users home directory.

if you need to create a "batch file" (called shell script in unix), just create a file with whatever editor you'd like (vi, vim, joe, ee, emacs, kwrite, nedit, xemacs, ...) and add the following into the first line:

#!/bin/sh

this causes the file to be executed by the standard shell of your system (in most cases bash). you could also set something like:

#!/bin/bash

or

#!/bin/tcsh

just don't forget to set the right permissions on the file (remember: in order to execute a file in unix it must have the executeable right set). do this by typing:

chmod 755 myfile.sh

(note the .sh at the end: this indicates to everyone that this SHOULD be a shell script) this will set the read, write and execute right to the owner (you) and the read and execute right to both group and others.

one other thing: often the current directory is not included in the default search path (given by the environment variable $PATH), so either copy the file to one of this paths (ie., /bin, /usr/bin, ...) or execute it with pathname by typing one of the following:

/full/path/to/myfile.sh
../myfile.sh (if your actualy in that directory)

so much for the one-point-question ;)
0
n0ctrnlCommented:
also, if you want an environment variable set for all users (global) set it in /etc/profile
If i wanted to set the variable $BLAH to be 'nothing' itd look like this:

export BLAH=nothing

thatd do it as well
      
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tummaAuthor Commented:
U are right i did experiment before this answer came and got the result
Anyway THANK U VERY MUCH FOR HELPING ME
THANKS AGAIN
ARUN
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.