- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Setting system variable
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 01:50 AM
05-27-2004 01:50 AM
It should stay defined.
This is needed to run an application.
Thanks for your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 01:56 AM
05-27-2004 01:56 AM
Re: Setting system variable
It is set default, as far as i know.
if not:
PWD=`pwd`
Regards,
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 01:59 AM
05-27-2004 01:59 AM
Re: Setting system variable
export PS1="\$PWD "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 02:00 AM
05-27-2004 02:00 AM
Re: Setting system variable
This should work.
# export PATH=`pwd`
Check to see the change affected;
# echo $PATH
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 02:00 AM
05-27-2004 02:00 AM
Re: Setting system variable
You need not set it manually
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 02:02 AM
05-27-2004 02:02 AM
Re: Setting system variable
Completely misread the question! The other answers here are correct.
However, $PWD is usually set by default
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 02:02 AM
05-27-2004 02:02 AM
Re: Setting system variable
I got confused ... Ignore entirely my post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 12:40 PM
05-27-2004 12:40 PM
Re: Setting system variable
Is there a particular reason you awnt it set to the current working directory?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 06:20 PM
05-27-2004 06:20 PM
Re: Setting system variable
I agree with Stuart: it is set automatically and I see no need to change it manually.
Check your shell's manual page. I cannot find $PWD in the sh-bourne man page (which doesn't mean PWD is not set automatically) but is is described in the sh-posix and ksh man page:
PWD: the present working directory set by the cd command.
((I am not sure about the c shell (csh). I cannot find PWD in the csh manpage (?? can you check that??). If your users are using the cshell you may change it to the posix shell (ask them first if they login interactively because the shells differ a lot!) or use 'setenv PWD $cwd'. On my Linux system (no HP-UX available at this moment) csh sets my $PWD automatically.))
What is your problem with the application?
If you type echo $PWD before starting the application do you see the current working directory?
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 09:04 PM
05-27-2004 09:04 PM
Re: Setting system variable
$ echo $PWD
/home/anshu
$ cd /tmp
$ echo $PWD
/tmp
So PWD will have the current directory information until unless its changed puposely.
More over, in your script you can always assign the value to PWD as follows:
PWD=`pwd`
HTH,
Anshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 10:35 PM
05-27-2004 10:35 PM
Re: Setting system variable
I think you want to store the PWD value at a given time. If you want this do:
export PWD_NOW=`pwd`;
And you'll have it stored in PWD_NOW!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2004 12:45 AM
05-28-2004 12:45 AM
Re: Setting system variable
Help me, Hp-wan-kenobi...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2004 12:52 AM
05-28-2004 12:52 AM
SolutionPWD is set in standard Posix shell. But if you are running some other shell that may not be the case.
Regards,
Trond
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2004 01:32 AM
05-28-2004 01:32 AM
Re: Setting system variable
it Requires exporting two variables
export PS1='$PWD'
export PWD=`pwd`
this should resolve your issue.
I generally place a "$" for not root users and "#" for root in the
export PS1='$PWD' # String
You can at this snippet into your profile to do that
export wai=`who am i|awk '{print $1}'`
if [ $wai = 'root' ]
then
export PS1='$PWD'"#"
export PWD=`pwd`
else
export PS1='$PWD'"$"
export PWD=`pwd`
fi
Hope it helps..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2004 01:40 AM
05-28-2004 01:40 AM
Re: Setting system variable
the snippet will work on most Un*x systems,
I've used it on Solaris, AIX, SCO, HP/UX, DG/UX, and Linux flavors. I've not tried "Cygwin" but my guess it'd work.
I noticed someone using PATH ??? don't forget your coffee before you write and test scripts, your wind up wandering what you did!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2004 01:41 AM
05-28-2004 01:41 AM
Re: Setting system variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2004 03:28 AM
06-02-2004 03:28 AM
Re: Setting system variable
If you are using csh: setenv PWD