- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- readonly variable in /etc/profile
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
12-02-2004 06:09 AM
12-02-2004 06:09 AM
readonly variable in /etc/profile
Following is a snippet of the code.
ulimit -n 2000
ulimit -c 0
echo after ulimit stmts >>/tmp/logindebug
# Set a timeout variable to 30 minutes
readonly TMOUT=1800
echo after the readonly stmt >>/tmp/logindebug
export TMOUT
echo got to number 3 >>/tmp/logindebug
echo 3 $PATH >>/tmp/logindebug
The last line I get in the /tmp/logindebug file is "after ulimit stmts".
The other thing I noticed which I don't know if it makes any difference is that my TERM variable is set to vt100 in TeraTerm and xterm in Exceed.
Has anybody run into this or does anybody have any ideas?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2004 06:18 AM
12-02-2004 06:18 AM
Re: readonly variable in /etc/profile
Use the statement like this,
TMOUT=1800
readonly TMOUT
export TMOUT
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2004 06:20 AM
12-02-2004 06:20 AM
Re: readonly variable in /etc/profile
When opening an exceed telnet window, use the option "-ls". This is used to tell xterm or hpterm to create the new window as a login shell. This will force the use of
the .profile file.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2004 06:40 AM
12-02-2004 06:40 AM
Re: readonly variable in /etc/profile
Splitting out the setting of the variable and making it readonly made no difference. But, when I split it apart and put an echo between the TMOUT=1800 statement and the export TMOUT statement, I didn't get a response to the echo.
I also checked the -ls option in Exceed and it is already there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2004 06:45 AM
12-02-2004 06:45 AM
Re: readonly variable in /etc/profile
export TMOUT
Does it help???
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2004 06:47 AM
12-02-2004 06:47 AM
Re: readonly variable in /etc/profile
You can try the xterm and profile issue this way.
create a file .Xdefaults in the $HOME
chmod 755 $HOME/Xdefaults
Add this entry to this file,
*loginShell: true
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2004 06:55 AM
12-02-2004 06:55 AM
Re: readonly variable in /etc/profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 08:21 AM
12-07-2004 08:21 AM
Re: readonly variable in /etc/profile
readonly TMOUT=1800
export TMOUT
causes everything after the "readonly" statement in /etc/profile to be ignored. BTW, /$HOME/.profile still executes!
typeset -r TMOUT=1800
export TMOUT
does the same thing as above
export & readonly TMOUT=1800
WORKS!!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 08:35 AM
12-07-2004 08:35 AM
Re: readonly variable in /etc/profile
Put these statements at the end of your .profile and see what that does with the other non-working versions and see what you get.
just for testing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 08:40 AM
12-07-2004 08:40 AM
Re: readonly variable in /etc/profile
readonly export TMOUT=1800
Something that will assist a lot in debugging profiles (and any scripts) is: set -x. This turns on tracing so you never need any echo statements to figure out what happened. You can also run your script with:
sh -x /etc/profile
and since the debugging output goes to stderr, you can use more or pg as in:
sh -x .profile 2>&1 | more
As far as setting TERM, always let ttytype set your TERM variable. You NEVER want to hardcode this value because you can't guarentee what users will be running when they login. Put this in /etc/profile:
eval $(ttytype -s)
To see what ttytype is dpoing, just type the command: ttytype -s
As far as the effect of changing TERM, this is a critical variable that tells applications how your terminal behaves. There are more than a thousand terminal entries in the /usr/bin/terminfo directory and they control what special character sequences are needed by programs that use Curses library calls. To see the differences between vt100 and xterm (and there are a lot):
untic vt100
untic xterm
A menu program like sam or glance or swinstall will looked very messed up if your TERM variable has nothing to do with the termi al that you are using.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2004 07:55 AM
12-13-2004 07:55 AM
Re: readonly variable in /etc/profile
readonly TMOUT=1800
echo past the readonly
readonly JUNK=whyme?
echo past the second readonly
export JUNK
I got the first echo output but not the second. I got the error message stating that JUNK was readonly and everything following was ignored. Interesting.
Bill,
Good point on the set -x . I keep forgetting that is there. Obviously I don't do much shell scripting! Also, I probably wasn't very clear but I wasn't setting the TERM variable. I am using ttytype to let the system set the TERM variable for me. I was merely pointing out what the settings of the variables were, thinking the different settings may have had a bearing on the problem I was having. Also, thanks for a different thread where you talked about the TSET command being outdated. I have the ttytype command in /etc/profile but somebody stuck the TSET in some .profile files and my emulated vt220 screens with non-default lines per screen wouldn't scroll the screen. I removed the TSET based on your other post and everything started scrolling like it should again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2004 02:21 AM
12-14-2004 02:21 AM
Re: readonly variable in /etc/profile
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2004 02:44 AM
12-14-2004 02:44 AM
Re: readonly variable in /etc/profile
I only have the TMOUT variable being set once. The error was occurring on the export command. To me it doesn't make any sense that exporting a variable that is defined as readonly should throw the error since exporting the variable doesn't change the value of it. It makes sense that once the error message is generated that the script stops running, it just doesn't make sense that the error should be generated in the first place.
Rex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2004 03:32 AM
12-14-2004 03:32 AM
Re: readonly variable in /etc/profile
Bill Hassell, sysadmin