setEnv.sh is found in which directory(path)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers setEnv.sh is found in which directory(path)
# 1  
Old 12-12-2007
setEnv.sh is found in which directory(path)

Hi,

I am new to Unix.I want to set the path and classpath setting for JDK1.4,Weblogic 9.2 and Oracle 9?
So i need to set those settings in setEnv.sh file.
But i am unable to find that file in my unix environment?
Pls. do tell me where this setEnv.sh is stored?
In which directory or path? Pls. do help me..
# 2  
Old 12-12-2007
There is no such file as setEnv.sh unless you create one. If you need, you can put those env variables in ~/.bashrc
# 3  
Old 12-12-2007
Vino Thanks, I am working in ksh . So where i can store those envronment variables with the settings?
# 4  
Old 12-12-2007
Quote:
Originally Posted by sachin.tendulka
Vino Thanks, I am working in ksh . So where i can store those envronment variables with the settings?
Usually $HOME/.kshrc
# 5  
Old 12-12-2007
The Kornshell uses two startup files to allow users to customize their shell environment.

$HOME/.profile (if one exists) and the startup file (if one exists) specified by the ENV environment variable (if set and exported). Normally this is set to $HOME/.kshrc.
# 6  
Old 12-12-2007
Beware, though, of relying on the environment set in .kshrc in your scripts: they might, once you have written and tested them, be run in a different environment (for instance from cron or under a different user) and variables like PATH, which you take for granted, might not be set in these environments.

The best way to deal with an environment inside scripts is to explicitly set it during startup of the script. I use a special function for that, which is executed at the beginning of all of my scripts:

Code:
#! /bin/ksh

. /usr/local/lib/ksh/f_env

# ... rest of your code ....

and /usr/local/lib/ksh/f_env would look like:

Code:
unset ENV
typeset -x OS=$(uname -a | cut -d' ' -f1)

case "$OS" in
     AIX)
          . /etc/environment
          ;;

     Linux)
           . /etc/profile
           ;;

     *)
           . /etc/environment
           ;;
esac
typeset -x LANG=C
typeset -x EDITOR=vi
typeset -x VISUAL=$EDITOR                   

typeset -x PATH="/usr/bin"
           PATH="$PATH:/bin"
           PATH="$PATH:/etc"
           PATH="$PATH:/usr/sbin"
           PATH="$PATH:/usr/ucb"
           PATH="$PATH:/sbin"
           PATH="$PATH:/usr/bin/X11"
           PATH="$PATH:/usr/local/bin"
           PATH="$PATH:/usr/local/sbin"

# ...etc., etc. ...

bakunin
# 7  
Old 12-13-2007
Guys, Thank u for ur replies... But i am not able find
.kshrc or .profile anywhere in my environment? Can u guys provide me the absolute path where it resides?
I have checked it in homedir where it is not there?
Pls. do reply...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

What is the difference ../directory path and ./directory path in ksh?

What is the difference ../directory path and ./directory path in ksh? (1 Reply)
Discussion started by: TestKing
1 Replies

2. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies

3. UNIX for Dummies Questions & Answers

Extract directory name from the full directory path in UNIX using shell scripting

My input is as below : /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/loyal/IFIND.HELLO.WROC.txt /splunk/scrubbed/triumph/ifind.triumph.txt From the above input I want to extract the file names only . Basically I want to... (5 Replies)
Discussion started by: IshuGupta
5 Replies

4. Solaris

samba network path not found

Hello I am new to solaris samba. After configuring samba through swat I can see the the machine listed under windows workgroup computers. when selected it shows the shared directories, But when trying to connect to shares shows a error network path not found. At the same time solaris network... (5 Replies)
Discussion started by: kc2dws
5 Replies

5. Shell Programming and Scripting

Retrieve directory path from full file path through sh

Hi, I have a file abcd.txt which has contents in the form of full path file names i.e. $home> vi abcd.txt /a/b/c/r1.txt /q/w/e/r2.txt /z/x/c/r3.txt Now I want to retrieve only the directory path name for each row i.e /a/b/c/ /q/w/e/ How to get the same through shell script?... (7 Replies)
Discussion started by: royzlife
7 Replies

6. Solaris

configure: error: no acceptable ld found in $PATH

When i configure apache(2.2.15) on solaris-8 server it producing following error <configure: error: no acceptable ld found in $PATH configure failed for srclib/apr > please help me any to fix this error. :confused: ---------- Post updated at 09:44 PM ---------- Previous update was... (0 Replies)
Discussion started by: kalpeer
0 Replies

7. Shell Programming and Scripting

Renaming of files with different extensions on the same path to .found with the help of loop

hi , I have certain files at the same path with differeent extensions like .dat , .txt etc ...........i need to rename them with extension .found at the same path with the help of loop.... also the files names will be like this ; abc_2010_c1.dat abc_2010_c2.dat xyz_2010_c1.txt (2 Replies)
Discussion started by: amitpta
2 Replies

8. UNIX for Dummies Questions & Answers

at crontab tcsh setenv: command not found

i have written a script "master.shell" which is in the path: /a/homes.surrey.ac.uk/pgt_fs_002/bl00001/phd/griddata/shell/master.shell ==================================== #/usr/local/bin/tcsh setenv GLOBUS_LOCATION /grid/software/globus3 setenv PATH... (1 Reply)
Discussion started by: binbintriangel
1 Replies

9. UNIX for Dummies Questions & Answers

cc path problem - no acceptable path found

Hello everyone, I'm a unix noob. I have a powerbook running mac os x 10.4 and for one of my classes I need to install the latest version of php (5.0.5). I'm following the instructions at http://developer.apple.com/internet/opensource/php.html to install but I've run into a problem. The... (2 Replies)
Discussion started by: kendokendokendo
2 Replies

10. Solaris

Path /usr/include/iso not found

Hello, I got a make compilation error saying make: *** No rule to make target `/usr/include/iso/stdio_iso.h', needed by `.test.d'. Stop. The mentioned folder `/usr/include/iso/' doesnt exist in solaris5.7 sparc that i am using. I need to know which package will actually install the... (1 Reply)
Discussion started by: Nads
1 Replies
Login or Register to Ask a Question