- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Something about shell scripting.
Operating System - HP-UX
1755751
Members
5040
Online
108837
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО09-17-2001 12:03 AM
тАО09-17-2001 12:03 AM
Re: Something about shell scripting.
Hi,
at least on Linux there are two slightly different ways to submit the su command:
su $account
or
su - $account
The difference is that with "-" (means login) there will be a completely new environment whereas without the old environment will be used. I tried that:
tboerner@N01049LUX:~/Download > export MY_TEST_VARIABLE="Some dummy value"
tboerner@N01049LUX:~/Download > echo $MY_TEST_VARIABLE
Some dummy value
tboerner@N01049LUX:~/Download > su - tb
Password:
tb@N01049LUX:~ > echo $MY_TEST_VARIABLE
tb@N01049LUX:~ > logout
tboerner@N01049LUX:~/Download > echo $MY_TEST_VARIABLE
Some dummy value
tboerner@N01049LUX:~/Download > su tb
Password:
tb@N01049LUX:/home/nokia/Download > echo $MY_TEST_VARIABLE
Some dummy value
tb@N01049LUX:/home/nokia/Download > exit
tboerner@N01049LUX:~/Download > echo $MY_TEST_VARIABLE
Some dummy value
Hope that helps a bit to explain your question.
Have a nice day
at least on Linux there are two slightly different ways to submit the su command:
su $account
or
su - $account
The difference is that with "-" (means login) there will be a completely new environment whereas without the old environment will be used. I tried that:
tboerner@N01049LUX:~/Download > export MY_TEST_VARIABLE="Some dummy value"
tboerner@N01049LUX:~/Download > echo $MY_TEST_VARIABLE
Some dummy value
tboerner@N01049LUX:~/Download > su - tb
Password:
tb@N01049LUX:~ > echo $MY_TEST_VARIABLE
tb@N01049LUX:~ > logout
tboerner@N01049LUX:~/Download > echo $MY_TEST_VARIABLE
Some dummy value
tboerner@N01049LUX:~/Download > su tb
Password:
tb@N01049LUX:/home/nokia/Download > echo $MY_TEST_VARIABLE
Some dummy value
tb@N01049LUX:/home/nokia/Download > exit
tboerner@N01049LUX:~/Download > echo $MY_TEST_VARIABLE
Some dummy value
Hope that helps a bit to explain your question.
Have a nice day
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2001 06:53 AM
тАО09-17-2001 06:53 AM
Re: Something about shell scripting.
Kenny sed: "So you means that I can not pass exported variables after I use the su - command?? But why the same scripts in my other machines will work?? Do you have any clue about this??"
>>>
Kenny, apparently on the machines where things work, the environmental vars you need are being set globally at the start of each user shell (like from /etc/profile). Compare the /etc/profiles from a system where things work and from a system where things are broken, and you'll probably see what's happening.
>>>
Kenny, apparently on the machines where things work, the environmental vars you need are being set globally at the start of each user shell (like from /etc/profile). Compare the /etc/profiles from a system where things work and from a system where things are broken, and you'll probably see what's happening.
"I have great faith in fools; self-confidence, my friends call it." --Poe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2001 02:24 AM
тАО09-18-2001 02:24 AM
Re: Something about shell scripting.
I agree with Thomas, there is a difference wether you are using the "-" or not.
This is clearly documented on the man page of su. Unfortunately su has been withdrawn from the XPG and POSIX standards. That could explain diverging implementations on different OS. There is no difference between HPUX10 and HPUX11 with respect to the su man page.
Klaus
There is a live before death!
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP