HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ENV= kshrc
Operating System - HP-UX
1834166
Members
3054
Online
110064
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
Forums
Discussions
Discussions
Discussions
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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
02-25-2005 07:57 AM
02-25-2005 07:57 AM
Can any tell me what this default ENV statement
does?
START=$HOME/.kshrc
ENV=${START[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}
As opposed to just using ENV=$HOME/.kshrc.
does?
START=$HOME/.kshrc
ENV=${START[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}
As opposed to just using ENV=$HOME/.kshrc.
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2005 10:02 AM
02-25-2005 10:02 AM
Solution
the result is that your .kshrc is sourced only if the shell being run is interactive. If the shell isn't interactive the .kshrc file isn't sourced.
it is explained in more detail in an HP shell manual:
http://docs.hp.com/en/B2355-90046/ch23s02.html
it is explained in more detail in an HP shell manual:
http://docs.hp.com/en/B2355-90046/ch23s02.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2005 03:18 AM
03-03-2005 03:18 AM
Re: ENV= kshrc
This is not working out for me.
Here is the doc info below. But like the
example below. I get an echo output for both
[0] and [1] which may explain why on some
non interactive scritps I get the stty: Not a
typewriter. message. Also get ": ( :" not
set. If the session is interactive then it
works.
----------------------------
You can turn off the processing of the ENV file for noninteractive shells with the following in your ~/.profile:
export ENV='${FILE[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}'
export FILE=$HOME/.envfile
The idea behind this scheme is to set up an array (FILE) whose first element is the file we want executed at startup, and whose second element is null.
$ export FILE=$HOME/.envfile
$ echo $FILE[0]/users/pbm/.envfile
$ echo $FILE[1]
$
-------------------------------------
Can anyone give more info on the use of this
function and does anyone have any good
way to set the DISPLAY. I am using the
following below in .profile. Two tests
because sun has different output with "who"
command. These statements are also giving
problems with NCD xterm booting of .xsession
file.
if [ "`uname -s`" = "HP-UX" ];then
DISPLAY=`/usr/bin/who -mR | awk '{print $6}' | sed -e "s/(//" -e "s/)//"`:0.0
else
DISPLAY=`/usr/bin/who -m | awk '{print $6}' | sed -e "s/(//" -e "s/)//"`
fi
export DISPLAY
Here is the doc info below. But like the
example below. I get an echo output for both
[0] and [1] which may explain why on some
non interactive scritps I get the stty: Not a
typewriter. message. Also get ": ( :" not
set. If the session is interactive then it
works.
----------------------------
You can turn off the processing of the ENV file for noninteractive shells with the following in your ~/.profile:
export ENV='${FILE[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}'
export FILE=$HOME/.envfile
The idea behind this scheme is to set up an array (FILE) whose first element is the file we want executed at startup, and whose second element is null.
$ export FILE=$HOME/.envfile
$ echo $FILE[0]/users/pbm/.envfile
$ echo $FILE[1]
$
-------------------------------------
Can anyone give more info on the use of this
function and does anyone have any good
way to set the DISPLAY. I am using the
following below in .profile. Two tests
because sun has different output with "who"
command. These statements are also giving
problems with NCD xterm booting of .xsession
file.
if [ "`uname -s`" = "HP-UX" ];then
DISPLAY=`/usr/bin/who -mR | awk '{print $6}' | sed -e "s/(//" -e "s/)//"`:0.0
else
DISPLAY=`/usr/bin/who -m | awk '{print $6}' | sed -e "s/(//" -e "s/)//"`
fi
export DISPLAY
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.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP