- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- .profile help
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
04-14-2004 02:21 AM
04-14-2004 02:21 AM
stty erase ^H
in .profile
but when I log in I cannot use backspace and have to set stty erase manually.
How can I get the .profile to work automatically?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2004 02:28 AM
04-14-2004 02:28 AM
SolutionNext check .profile to see if any if conditions might cause this portion of the code not to be executed.
Also, you should eclose the stty arguments in quotes:
e.g. stty erase "^H"
Finally, don't overlook the obvious. You stty may be overridden by later stty commands especially if your .profile sources other scripts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2004 02:29 AM
04-14-2004 02:29 AM
Re: .profile help
# set erase to ^H, if ERASE is not set
if [ "$ERASE" = "" ]
then
ERASE="^H"
export ERASE
fi
stty erase $ERASE
I'd run through /etc/profile and .profile and see if the settings are overwritten.
Further, your terminal software can sometimes be incompatible with this setting, and some detail on this would be helpful. What client are we using?
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2004 02:33 AM
04-14-2004 02:33 AM
Re: .profile help
The "^H" worked!
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2004 05:42 AM
04-14-2004 05:42 AM
Re: .profile help
Setup -> Terminal -> Keyboard
and change "VT Backspace sends" from Delete to Backspace. That takes care of your emulator.
Now login (the actual character-mode prompt, not an Xwindow CDE or VUE login window) defaults to the (very) old standard of backspace = # and delete-line = @. These were very common character codes in the days when terminals had paper and ink (ie, a Teletype machine or similar). Can't really backspace on a paper terminal to erase characters...
So to fix this problem with the login program, HP-UX 11.0 and higher has added a new device file: /dev/ttyconf which is used to establish new defaults for stty settings prior to login and /etc/profile. You can do this:
/sbin/stty erase "^H"
or better yet:
/sbin/stty erase "^H" kill "^U" intr "^C" eof "^D" -parity ixoff
which sets all the important values. Once issued, this command changes the defaults for all new logins and 'sticks' between reboots. Note that the console default will not take effect until a reboot has occcurred. However, I have noticed that it doesn't always 'stick' (may be a patch issue) so I run it in cron around 2am in the morning.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2004 08:14 AM
04-19-2004 08:14 AM
Re: .profile help
| First, if this is a CDE login, make certain
| that DTSOURCEPROFILE=true is set in .dtprofile.
But a CDE login does not source ~/.profile for each login when DTSOURCEPROFILE=true. That flag says to source ~/.profile once when logging in to CDE. It is important to avoid tty operations in .profile at that time. Commands like stty and tset need to be protected from running by a test like-
if [ ! "$DT" ]; then
stty erase "^H"
fi
Otherwise a failing .profile command could prevent a CDE login from working.
CDE terminal emulators normally get their initial tty settings from an X resource. The /usr/dt/config/C/sys.resources file contains a default setting of "sys.resources:*ttyModes: erase ^H intr ^C kill ^U start ^Q stop ^S swtch ^@ susp ^Z" which the terminal emulators such as dtterm use.
It is also possible to set resources or options to cause terminal emulators to start a login shell that will source ~/.profile at startup.