![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| environment variable | sharanbr | Shell Programming and Scripting | 8 | 06-12-2007 05:43 AM |
| Environment variable values encrption in profile | kalpana.anuga | AIX | 1 | 02-13-2007 10:46 PM |
| Where's the .profile environment config for root under Bourne shell? | Joncamp | SUN Solaris | 2 | 12-02-2006 01:22 AM |
| Profile and environment variable | unclefab | SUN Solaris | 2 | 05-12-2005 06:57 AM |
| Modifying $PATH variable in /etc/profile | Deepali | UNIX for Dummies Questions & Answers | 3 | 03-12-2001 09:17 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
1.) How is .profile and environment variable linked.? 2.) What happens when we execute a script.? |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Answer to your first question:
When you login, the various commands in the .profile are run. This may include setting the path, the prompt, and a host of other things. An example .profile: Code:
PATH=/usr/bin:/usr/sbin:/sbin; export PATH MANPATH=/usr/share/man:/opt/<some_app>/man; export MANPATH /usr/games/fortune I didn't get the second question. I mean, when you run a script, the various commands in the script are executed. What more? |
|
#3
|
|||
|
|||
|
If that is so, then what is env used for
If that is so, then what is `env` used for ?
1.) where can we find the `env` file ? 2.) When we run `env` command , we find list of things. What is the use of it & How to change it .? |
|
#4
|
||||
|
||||
|
From the man page of env:
Quote:
To understand what the above paragraph says, let us take an example (this is for ksh): Code:
$ export ORACLE_SID=abc; export ORACLE_HOME=/oracle817 $ sqlplus internal SQL> set pages 1000; SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- ---------- ABC MOUNTED SQL> exit; $ env ORACLE_SID=xyz sqlplus internal SQL> set pages 100 SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- ---------- XYZ MOUNTED SQL> exit; $ env|grep ORA ORACLE_SID=abc ORACLE_HOME=/oracle817 1) The 'env' command does not read from a file, the environment is stored in the memory. From the man page of environ: Quote:
For sh: Code:
PATH=/usr/bin; export PATH Code:
export PATH=/usr/bin Code:
setenv PATH /usr/bin [/code] |
||||
| Google The UNIX and Linux Forums |