- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How do you define an alias?
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
11-22-2004 04:15 AM
11-22-2004 04:15 AM
Angie
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 04:21 AM
11-22-2004 04:21 AM
Re: How do you define an alias?
It depends of you shell - using ksh its just
alias='your alias'
e.g.
alias ll='ls -al'
All the best
Victor
P.S.
If you want to use them at each connection then put your aliases in a .kshrc and modify your .profile to take account: ENV= $HOME/.kshrc;export ENV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 04:25 AM
11-22-2004 04:25 AM
Re: How do you define an alias?
I want the aliases to be saved forever, don't want to have to redefine them each time.
Thank you,
Angie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 04:27 AM
11-22-2004 04:27 AM
Re: How do you define an alias?
alias lsetc='ls -l /etc'
That's all there is to it. I suspect the aliases you are seeing are those that are compiled into the shell rather than being read in in .profile.
The built-in aliases include
autoload='typeset -fu'
integer='typeset -i'
to name a few.
These built-ins can be redefined or unset if you like. Man sh-posix for details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 04:31 AM
11-22-2004 04:31 AM
Re: How do you define an alias?
put the aliases in .profile
just alias aliasname='
You should see them (I hope) at next connection
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 04:32 AM
11-22-2004 04:32 AM
Re: How do you define an alias?
Also, the ones that I see are the following:
nohup
stop
suspend
function
integer
local
autoload
command
So maybe you answered the question then as to why I can't find where they are pulling from.
Thanks - Angie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 04:39 AM
11-22-2004 04:39 AM
Re: How do you define an alias?
alias m='more'
it works fine. The .profile file is in my home directory on the NFS mount. What is going on???
Thanks... Angie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 04:50 AM
11-22-2004 04:50 AM
Re: How do you define an alias?
- Create a alias file my_alias
- put all the alias you want there
- add in your .profile:
. $HOME/my_alias
Then test:
this works at new connection time...
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 04:50 AM
11-22-2004 04:50 AM
Re: How do you define an alias?
to make the alias change permanent, add it to your profile. You need to logout and login again to make it work.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 04:50 AM
11-22-2004 04:50 AM
Re: How do you define an alias?
The other possibility is that you are using CDE and have not set DTSOURCEPROFILE=true in your .dtprofile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 04:50 AM
11-22-2004 04:50 AM
Re: How do you define an alias?
you can make it active for that session by typing:
. ./.profile
(that's 3 "."s)
OR your next login should make it active.
Best regards,
Oz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 04:54 AM
11-22-2004 04:54 AM
Re: How do you define an alias?
I just tested: with posix you have no problem with alias in .profile, not true for ksh where you will have to do the previous my_alias...
As mentionned it workes at next connection only
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 05:13 AM
11-22-2004 05:13 AM
Re: How do you define an alias?
I uncommented it.
Thank you all for your input and let you know.
Angie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 05:33 AM
11-22-2004 05:33 AM
Re: How do you define an alias?
I did leave the DTSOURCEPROFILE=true uncommented in that .dtprofile file.
I wonder why this isn't working.
Angie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 05:40 AM
11-22-2004 05:40 AM
SolutionMaybe this link from itrc would help,
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063204439
The itrc doc id is KBRC00000416.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 05:59 AM
11-22-2004 05:59 AM
Re: How do you define an alias?
Wish it was more simple though!
Angie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 07:57 AM
11-22-2004 07:57 AM
Re: How do you define an alias?
The following exported aliases are compiled into the shell but can be
unset or redefined:
autoload='typeset -fu'
false='let 0'
functions='typeset -f'
hash='alias -t -'
history='fc -l'
integer='typeset -i'
nohup='nohup '
r='fc -e -'
stop='kill -STOP'
suspend='kill -STOP $$'
true=':'
type='whence -v'
You can put in .profile or .kshrc.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 08:00 AM
11-22-2004 08:00 AM
Re: How do you define an alias?
The key is that when you start a terminal window in CDE, you are bypassing *all* the 'normal' Unix processes. If you run telnet from your PC to HP-UX, you'll login and /etc/profile plus your local .profile will be run automatically. CDE figures you don't need any of that so the default is to ignore it all. The .dtprofile file cannot specify /etc/profile so you'll neever get your settings from /etc/profile, just .profile when DTSOURCEPROFILE value is set true.
So the default aliases (which are listed in the man page for sh-posix and ksh) are the ones you posted. Any additional aliases defined in .profile will be set when you use telnet (and no Xwindows).
If you must use CDE, then you need to put a special file in your $HOME directory (same place as .profile) called .Xdefaults which sets the default values (Xresources) for Xwindow programs like dtterm and xterm. Put the following lines into a file called $HOME/.Xdefaults on the HP-UX server:
*LoginShell: True
Now when you start a CDE sessions and then a dtterm or xterm or hpterm window, a normal Unix login will take place and both /etc/profile and .profile will be run.
But the real problem is that you're using CDE to manage your PC's desktop, possibly not what you want at all. If you are just starting terminal windows like dtterm or xterm, don't bother starting a CDE session and Exceed at all. Instead, start a terminal emulator like the Windows telnet program or use a free terminal emulator like QCTerm. You'll get a normal login
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 08:01 AM
11-22-2004 08:01 AM
Re: How do you define an alias?
The key is that when you start a terminal window in CDE, you are bypassing *all* the 'normal' Unix processes. If you run telnet from your PC to HP-UX, you'll login and /etc/profile plus your local .profile will be run automatically. CDE figures you don't need any of that so the default is to ignore it all. The .dtprofile file cannot specify /etc/profile so you'll neever get your settings from /etc/profile, just .profile when DTSOURCEPROFILE value is set true.
So the default aliases (which are listed in the man page for sh-posix and ksh) are the ones you posted. Any additional aliases defined in .profile will be set when you use telnet (and no Xwindows).
If you must use CDE, then you need to put a special file in your $HOME directory (same place as .profile) called .Xdefaults which sets the default values (Xresources) for Xwindow programs like dtterm and xterm. Put the following lines into a file called $HOME/.Xdefaults on the HP-UX server:
*LoginShell: True
Now when you start a CDE sessions and then a dtterm or xterm or hpterm window, a normal Unix login will take place and both /etc/profile and .profile will be run.
But the real problem is that you're using CDE to manage your PC's desktop, possibly not what you want at all. If you are just starting terminal windows like dtterm or xterm, don't bother starting a CDE session and Exceed at all. Instead, start a terminal emulator like the Windows telnet program or use a free terminal emulator like QCTerm. You'll get a normal login like any Unix box with all the aliases and env settings.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2004 11:09 AM
11-22-2004 11:09 AM
Re: How do you define an alias?
Appreciate all the responses.
Angie