- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: setting environment variables
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
08-18-2004 10:03 AM
08-18-2004 10:03 AM
How do i go about changing a global environment variable?
for example:
typing cd fromsteve at the prompt takes me to /opt/fromsteve, I need that to point to /var/opt/fromsteve
A step by step guide would be very helpful for a newbie :-)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2004 10:24 AM
08-18-2004 10:24 AM
Re: setting environment variables
cd fromsteve
environment variables are referenced via a $
so it would be
cd $fromsteve
if there is no $, you might have an alias setup
see what typeset -f returns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2004 10:28 AM
08-18-2004 10:28 AM
Re: setting environment variables
alias something='command'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2004 01:07 PM
08-18-2004 01:07 PM
Re: setting environment variables
An alias is supposed to be just one work right? Like if i say "fromsteve" it performs the command cd /var/opt/fromsteve.
In this case it's cd fromsteve with no $
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2004 05:10 PM
08-18-2004 05:10 PM
Re: setting environment variables
$whereis cd
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2004 05:18 PM
08-18-2004 05:18 PM
Re: setting environment variables
what is ll fromsteve saying.
Is it a link to /opt/fromsteve directory?
If so then,
Remove the old link
rm -f fromsteve
Create new link to /var/opt/fromsteve file
ln -s /var/opt/fromsteve fromsteve
If you do cd fromsteve
It will access all files and directories on /var/opt/fromsteve directory.
Else,
alias
what is it saying.?
Any alias are there?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2004 05:48 PM
08-18-2004 05:48 PM
Re: setting environment variables
As muthukumar said, i also doubt the same.
You must be having a soft link to the directory /opt/fromsteve which was created as follows:
# ln -s /opt/fromsteve fromsteve
Now that you want to point it to /var/opt/fromsteve rerun the following command:
# unlink fromsteve
# ln -s /var/opt/fromsteve fromsteve
Hope this is the situation.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2004 12:22 PM
08-19-2004 12:22 PM
Re: setting environment variables
but i did something: I deleted the old directory /opt/fromsteve
when i do a "cd fromsteve" i now get directed to /var/opt/fromsteve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2004 04:25 PM
08-19-2004 04:25 PM
Solutionwhat is your environment variable CDPATH saying??
echo $CDPATH
It will relocate the files / directories under their path.
Test:
[/] # CDPATH=/opt/
[/] # cd fromsteve
It will go to /opt/fromsteve
where [/] shows PWD
[/] # CDPATH=/var/opt/
[/] # export $CDPATH
[/] # cd fromsteve
/var/opt/fromsteve
[/var/opt/fromsteve] #
It will go to /var/opt/fromsteve
HTH.
Regards
Muthu