Profile File in Unix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Profile File in Unix
# 1  
Old 09-04-2008
Profile File in Unix

Hi,

I have to run a sqr program.
In the profile file everything is set.

e.g
APPLID=personel
APPPATH=/${ENVIRONMENT}/${APPPATH}

and so on..

SQRDIR=/opt/sqr/bin/syb

Still when I'm running this script,its giving error APPLID not set and SQRDIR not set.

Any idea,why?
TIA
# 2  
Old 09-04-2008
Have you export the variables?

Regards
# 3  
Old 09-04-2008
yes ..

export APPLID APPPATH ...
# 4  
Old 09-04-2008
The contents of /etc/profile and .profile are only read by a login shell i.e. the shell that is spawned when you login to your system. If you are using bash try putting the required variables in your .bashrc, or in .kshrc if you are using ksh. Also you should export the variables.
# 5  
Old 09-04-2008
You can also source the profile file before you start your script:

Code:
. /dir/profile.file

Regards
# 6  
Old 09-07-2008
jus run the command "set" in unix prompt and see the whther the varibale i exported or not.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Remote login UNIX box from java passing parameters to the custom script called in the profile

Hello Good Day / Guten Tag.... I have to login the server and the user profile contains some scripts which need the inputs to be taken from the keyboard. So I use the method to conn.authenticateWithKeyboardInteractive(username, new InteractiveCallback() { public String... (1 Reply)
Discussion started by: Sanalkumaran
1 Replies

2. UNIX for Dummies Questions & Answers

Where to see my .profile file in UNIX?

Hi where to see my .profile file in unix thanks Dharma (2 Replies)
Discussion started by: na.dharma
2 Replies

3. Shell Programming and Scripting

.profile issue with UNIX

Hi, There is a user in Solaris-10 zone, ora_big01. Its .profile is not getting executed due to some reason and I am not able to find that. root@trddpd-dwsq04:/# cat /etc/passwd | grep -i ora_big01 ora_big01:x:242349:220:Siebel for QA:/ccq/apps/siebel:/usr/bin/ksh root@trddpd-dwsq04:/# which ksh... (3 Replies)
Discussion started by: solaris_1977
3 Replies

4. Shell Programming and Scripting

problem in creating execute profile file in unix

first i created a profile file(my_var.profile) which contains export my_var=20 after that i created shell scripts(my_var.sh) which contains #!/bin/bash . ./my_var.profile echo '$my_var='$my_var but when i am executing sh my_var.sh it is showing error that no such file/directory .profile.... (6 Replies)
Discussion started by: pratikjain998
6 Replies

5. Shell Programming and Scripting

problem in creating my own profile file in unix

I am new in shell scripting. currently i am using cygwin. My problem is i created a profile file in my own folder. file name is first.profile in which i gave following values to variable export a=10 now i am executing this profile file by below command ./.first.profile it executed... (4 Replies)
Discussion started by: pratikjain998
4 Replies

6. UNIX for Dummies Questions & Answers

how to open .profile in Korn UNIX

How to open/view .profile file in Korn Unix. I need the path to .profile as well. Thanks, Kumar (1 Reply)
Discussion started by: vasan2815
1 Replies

7. UNIX for Dummies Questions & Answers

full path of .profile in unix

need a help, am a newbe in unix how do i locate the full path of the .profile where the environmental variable for a user is set. thanks (6 Replies)
Discussion started by: dba
6 Replies

8. Shell Programming and Scripting

Can I modify the .bashrc file instead of .profile file to customize my login?

Hello, I got this question which tells me to customize my login script. Some people in the forums suggested to modify the .profile file in my home directory. I did so, but none of my customizations show up when I open the terminal after. So, I tried to modify other files in my home directory,... (1 Reply)
Discussion started by: Hyunkel
1 Replies

9. Shell Programming and Scripting

What is .profile in unix ?

1. What is .profile in unix ? 2. What are they used for ? (2 Replies)
Discussion started by: guhas
2 Replies

10. UNIX for Dummies Questions & Answers

changed .profile but didnt ./.profile, yet reflected changes

hi , i added ls -F to .profile. and i need to do ./.profile for the effect to take effect BUT i didnt and YET the next day when i came to work and log in, the changes took effect. i am on aix. please explain.. thanks (4 Replies)
Discussion started by: yls177
4 Replies
Login or Register to Ask a Question