HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Command aliases /bin/sh
Operating System - HP-UX
1825795
Members
2385
Online
109687
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
07-12-2006 10:00 AM
07-12-2006 10:00 AM
HP-UX 11.11...
Trying to define aliases for a user using /bin/sh. I've added the alias to .profile and it works for a telnet session, but not for a CDE xterm. I have uncommented DTSOURCEPROFILE=true in the .dtprofile and verified that the .profile and my alias command are executed, but the alias is not there. I've even tried alias -x in the .profile, no change for the xterm.
Meanwhile, there are system-wide aliases showing up in both telnet and CDE xterm sessions. Where are those defined? Not in /etc/profile.
thanks for putting up with my n00b question...
Trying to define aliases for a user using /bin/sh. I've added the alias to .profile and it works for a telnet session, but not for a CDE xterm. I have uncommented DTSOURCEPROFILE=true in the .dtprofile and verified that the .profile and my alias command are executed, but the alias is not there. I've even tried alias -x in the .profile, no change for the xterm.
Meanwhile, there are system-wide aliases showing up in both telnet and CDE xterm sessions. Where are those defined? Not in /etc/profile.
thanks for putting up with my n00b question...
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2006 10:16 AM
07-12-2006 10:16 AM
Solution
Not a noob questions, but a very obscure 'feature' in Xwindow terminal emulators xterm, hpterm and dtterm. These emulators by default do not login in a 'normal' way and therefore do not start a login shell. While you can set the variable in .dtprofile, the correct way to match Xwindows with a normal modem/serial or telnet login (so it executes /etc/profile and then .profile, the normal way) is to create this file in each user's $HOME directory:
echo "*loginShell: true" >> $HOME/.Xdefaults
Now, each terminal window will login the same way as a telnet login.
BTW: there is no program /bin/sh in HP-UX (or Solaris for that matter). If you look at the /bin directory with:
ll -d /bin
you'll see that this is not a directory but a temporary transition link. The real location for /bin files is /usr/bin so all your users should have /usr/bin/sh (or whatever shell they use) in /etc/passwd. This directory has been standard for SysV (v.4 filesystem layout) for more than 10 years. HP will be removing these links in future revisions as part of a normal installation although tlinstall will still exist for a while.
Bill Hassell, sysadmin
echo "*loginShell: true" >> $HOME/.Xdefaults
Now, each terminal window will login the same way as a telnet login.
BTW: there is no program /bin/sh in HP-UX (or Solaris for that matter). If you look at the /bin directory with:
ll -d /bin
you'll see that this is not a directory but a temporary transition link. The real location for /bin files is /usr/bin so all your users should have /usr/bin/sh (or whatever shell they use) in /etc/passwd. This directory has been standard for SysV (v.4 filesystem layout) for more than 10 years. HP will be removing these links in future revisions as part of a normal installation although tlinstall will still exist for a while.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2006 10:30 AM
07-12-2006 10:30 AM
Re: Command aliases /bin/sh
I'm not sure why you're broken (I'm guessing that the terminal you're running isn't in "sh" but something else, so the environment vars didn't come over - OR you didn't "export" the variables in the .profiles. My guess is that the vars aren't exported after being defined.
A possible fix for this is to put the variable assignment and export command you want run in the ".shrc" file (.bashrc .cshrc .tcshrc .kshrc, whichever shell you're running). This will make the assignment everytime the shell is invoked as opposed as to every time a login occurs.
"echo $0" from inside your terminal to find out what shell you're actually running once at a prompt.
A possible fix for this is to put the variable assignment and export command you want run in the ".shrc" file (.bashrc .cshrc .tcshrc .kshrc, whichever shell you're running). This will make the assignment everytime the shell is invoked as opposed as to every time a login occurs.
"echo $0" from inside your terminal to find out what shell you're actually running once at a prompt.
We are the people our parents warned us about --Jimmy Buffett
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 07:18 AM
07-13-2006 07:18 AM
Re: Command aliases /bin/sh
FWIW my shell was /usr/bin/sh. I had tried .bashrc and .shrc but neither did anything.
Bill's answer did the trick. Thanks Bill.
Bill's answer did the trick. Thanks Bill.
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP