- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Adding addition VARIABLE to default env
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
09-28-2001 05:52 AM
09-28-2001 05:52 AM
if I run the command
remsh cancun env it returns the basic info
PATH=/usr/bin:etc
LOGNAME=jmarrion
SHELL=/usr/bin/sh
HOME=/jmarrion
PWD=/home/jmarrion
TZ=EST5EDT
What I would like is to have another one
VAXSVR=maui
I have added this to /etc/profile but it only display the variable if the user logins into the platforms. With the remsh command it doesnt show.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2001 06:01 AM
09-28-2001 06:01 AM
Re: Adding addition VARIABLE to default env
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2001 06:05 AM
09-28-2001 06:05 AM
Re: Adding addition VARIABLE to default env
By default, remsh uses the path (from the man page)/usr/bin:/usr/ccs/bin:/usr/bin/X11
to execute another profile
remsh cancun . ~/.profile ; env
or if you have a file where you have all your environment variables stored, source it and then check your env
remsh cancun -n ". envfile ; env"
Check the man page of remsh for more information
-HTH
Ramesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2001 06:07 AM
09-28-2001 06:07 AM
Re: Adding addition VARIABLE to default env
One more thing, if you are just looking for this one variable then you could try something like,
remsh cancuun "export VAXSRV=maui ; env"
-Regards
Ramesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2001 06:07 AM
09-28-2001 06:07 AM
Re: Adding addition VARIABLE to default env
remsh doesn't execute your .profile.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2001 06:19 AM
09-28-2001 06:19 AM
SolutionOne approach is to add your variable to the remote users .profile.
something like this:
remsh remotehost . .profile 2>&- \; mycmd.sh
The 2>&- discards any error messages genererated by terminal related commands like stty when stdin is not a terminal. mycmd.sh is then run with the environment setup.
You could alter the .profile to test for this condition and bypass the stty stuff and not have to use the 2>&- stuff.
Like this:
if [ -t 0 ]
then
stty ...
tabs ...
fi
I normally do the in my .profiles anyway.
You could also include an entry to source your variables from a localfile
. /usr/local/bin/env.sh
and env.sh would look like this
VAXSVR=maui
HOST=`usr/bin/hostname`
export VAXSVR HOST
Just don't put an exit statement at the end of this sourced file.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2001 06:25 AM
09-28-2001 06:25 AM
Re: Adding addition VARIABLE to default env
1. For one thing we all use sh or ksh here.
2. I have added the VAXSVR variable to /etc/d.profile so it is set in everyones /home/.profile
3. What I do not want to do is to have to source the .profile for each script that I have written to set the VAXSVR variable on remote processing.
4. What I was hopping for, that there is a way to ADD the VAXSCR variable to be set like PATH, SHELL,HOME, PWD,TZ. They seem to me to be system defaults
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2001 06:35 AM
09-28-2001 06:35 AM
Re: Adding addition VARIABLE to default env
When I execute the following
remsh cancun . .profile 2>&- \; /tmp/t.sh
it returns fd = 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2001 06:51 AM
09-28-2001 06:51 AM
Re: Adding addition VARIABLE to default env
Set it in /etc/profile. If I understood correctly, you want the users to use $VAXVAR variable to do remsh.
Like
$remsh $VAXVAR -l login some_command.
You need to set it in /etc/profile not d.profile.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2001 08:26 AM
09-28-2001 08:26 AM
Re: Adding addition VARIABLE to default env
I did the 2>&- \; from memory but it turns out that this old head was ok. I just tried the exact same syntax on a pair of my boxes and all was ok. I rather suspected you had multiple
servers and that is why I included setting HOST in my earlier example. You could do the same thing and have your .profile run hostname to set that for you.
The exact syntax I used was:
remsh bugs . .profile 2>&- \; ./test.sh
Test shell in my home directory looked like this:
#!/usr/bin/sh
HOST=`/usr/bin/hostname`
echo "This is a test from ${HOST}."
exit 0
The output when run using the above remsh was
"This is a test from bugs." - just as expected.
Regards, Clay