01-17-2012
Hi,
Both are same w.r.t functionality , This variable points to the current directory
But $PWD is an environmental variable which can be used to set to a particular session/shell /script
Working principles of environment variables
A few simple principles govern how environment variables BY INSTALLING, achieve their effect.
Local to process
Environment variables are local to the process in which they were set. That means if we open two terminal windows (Two different processes running shell) and change value of environment variable in one window, that change will not be seen by other window.
Inheritance
When a child process is created, it inherits all the environment variables and their values from the parent process. Usually, when a program calls another program, it first creates a child process by forking, then the child adjusts the environment as needed and lastly the child replaces itself with the program to be called. This procedure gives the calling program control over the environment of the called program.
Case sensitive
In Unix and Unix-like systems the names of environment variables are case sensitive.
Persistence
Environment variables persistence can be session-wide or system-wide.
thanks,
venkat
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
We all know that pwd (or echo $PWD) gives us the present working dir as output.... but my doubt is that I'ld like to know how to get the present working folder - I mean - name of the current folder alone.. using pwd command I get the full folder name (right from root path)... I need to know... (2 Replies)
Discussion started by: mohanprabu
2 Replies
2. UNIX for Dummies Questions & Answers
Home directory mounted on one local system as /home/username, same directory mounted on a remote system as /home/engr/username.
How to use command to use remote host pwd. For example
rsh <remote host> ls -l ~pwd (2 Replies)
Discussion started by: bugsandbunny
2 Replies
3. UNIX for Advanced & Expert Users
Can anyone explain this in detail ...
echo ${PWD#${PWD%/*/*}/}
Thanks in Advance (1 Reply)
Discussion started by: sakthi.abdullah
1 Replies
4. UNIX for Advanced & Expert Users
Hi people...
i recently installed AIX 5.3 on a server...
but now when i login with root it only shows '# ' without the location where i am...
for example: if im in /usr/local
it continues to show only '# '
and i want to see the path like 'root@server:/usr/local#'
someone can help me? ... (2 Replies)
Discussion started by: gfca
2 Replies
5. UNIX for Dummies Questions & Answers
i've been searching the way to connect to pwd.db file located in /etc/ directory..
since i'm not the root and only one of the users of the server, i need to connect to the database so that i can make a login page for all users of the server..
the file is readable by all users and the permission... (1 Reply)
Discussion started by: meggae
1 Replies
6. UNIX for Dummies Questions & Answers
Hi,
Can you tell me if there is a command such as pwd which does not give me the absolute NFS pathname i.e. it starts with .autofs? At the moment on the unix when I use the 'pwd' command it always gives me the nfs pathname rather thanthe local pathname of which is what i want, is there an... (4 Replies)
Discussion started by: cyberfrog
4 Replies
7. AIX
currently, my samba login works just fine. i want my clients to use aix5.3 account to login to samba so they don't have to change samba pwd and aix pwd. i googled, and vi /usr/lib/smb.conf per some of knowledge base, but i could not get to work.
aix5.3 and samba 3.0.24.0
thanks in advace..... (2 Replies)
Discussion started by: tjmannonline
2 Replies
8. UNIX for Dummies Questions & Answers
Dear users,
One more question, In unix when i use pwd the following I get:
pwd
/Users/username/src/directory name
Is there a way to get the out put like this in which the if there is a space in the directory eg directory name it should show as directory\ name:... (2 Replies)
Discussion started by: kevincobain2000
2 Replies
9. Shell Programming and Scripting
Dear all,
I am trying to use 'pwd' command in following way.
current_directory == /dirA/dirB/test/dirC
if ; then
do this
fi
I am not sure how to pass this in command way. Please help!
thanking you,
emily (10 Replies)
Discussion started by: emily
10 Replies
10. UNIX for Beginners Questions & Answers
Hi all,when I cd to an environment variable "cd $MYDIR, if I type pwd, I don't the path to the environment variable dir I cd to. Appreciate the help, regards..Abbya (5 Replies)
Discussion started by: abbya
5 Replies
LEARN ABOUT SUSE
gnome-session
GNOME-SESSION(1) General Commands Manual GNOME-SESSION(1)
NAME
gnome-session - Starts up the GNOME desktop environment
SYNOPSIS
gnome-session [--autostart=DIR] [--default-session-key=KEY] [--failsafe|-f] [--debug]
DESCRIPTION
The gnome-session program starts up the GNOME desktop environment. This command is typically executed by your login manager (either gdm,
xdm, or from your X startup scripts). It will load either your saved session, or it will provide a default session for the user as defined
by the system administrator (or the default GNOME installation on your system).
The default session is defined in the GConf keys under /desktop/gnome/session. When saving a session, gnome-session saves the currently
running applications in the $XDG_CONFIG_HOME/gnome-session/saved-session directory.
gnome-session is an X11R6 session manager. It can manage GNOME applications as well as any X11R6 SM compliant.
OPTIONS
The following options are supported:
--autostart=DIR
Start all applications defined in DIR, instead of starting the applications defined in /desktop/gnome/session/default_session, or
via the --default-session-key option. Multiple --autostart options can be passed.
--default-session-key=KEY
Sets the GConf key from which applications running a default session should be read to KEY. If not specificed, /desktop/gnome/ses-
sion/default_session will be used.
--failsafe
gnome-session will run in fail-safe mode. User-specified applications will not be started.
--debug
Enable debugging code.
ENVIRONMENT
gnome-session accepts all of the standard environment variables used by gnome programs, other than the SESSION_MANAGER environment vari-
able. gnome-session also sets several environment variables for the use of its child processes.
SESSION_MANAGER
This variable is used by session-manager aware clients to contact gnome-session.
DISPLAY
This variable is set to the X display being used by gnome-session. Note that if the --display option is used this might be different
from the setting of the environment variable when gnome-session is invoked.
SEE ALSO
gnome-session-properties(1) gnome-session-save(1) gnome-wm(1)
BUGS
If you find bugs in the gnome-session program, please report these on http://bugzilla.gnome.org.
GNOME GNOME-SESSION(1)