- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- setting aliases
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
03-30-2004 08:07 PM
03-30-2004 08:07 PM
I need to set an alias for a command, but it is not exported even when using -x. Here is what I have :
#alias -x foo=yeah
#alias -x
autoload='typeset -fu'
command='command '
foo=yeah
functions='typeset -f'
history='fc -l'
integer='typeset -i'
local=typeset
nohup='nohup '
r='fc -e -'
stop='kill -STOP'
suspend='kill -STOP $$'
type='whence -v'
#sh
#alias
autoload='typeset -fu'
command='command '
functions='typeset -f'
history='fc -l'
integer='typeset -i'
local=typeset
nohup='nohup '
r='fc -e -'
stop='kill -STOP'
suspend='kill -STOP $$'
type='whence -v'
Isn't my alias supposed to exist in subshells ?
And where are other aliases set ? (can't find them in profile)
"Reality is just a point of view." (P. K. D.)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 08:29 PM
03-30-2004 08:29 PM
Re: setting aliases
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 08:38 PM
03-30-2004 08:38 PM
Re: setting aliases
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 08:45 PM
03-30-2004 08:45 PM
Re: setting aliases
"Exported aliases remain in effect for subshells but must be reinitialized for separate invocations of the shell"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 08:53 PM
03-30-2004 08:53 PM
Re: setting aliases
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 09:01 PM
03-30-2004 09:01 PM
Re: setting aliases
Have you set the alias as below?
alias dir=ls
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 09:08 PM
03-30-2004 09:08 PM
Re: setting aliases
I'll try to use ENV variable to set up aliases for each new shell (even if I think alias -x should have worked :)
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 09:32 PM
03-30-2004 09:32 PM
Solutionalias -x jlo='pwd'
alias jlo2='ls -C1'
~~~~~~~~~~~~~~~~~~~~~~~~
alias in current shell => I have both in the list
~~~~~~~~~~~~~~~~~~~~~~~~
sh : create new shell => I have none of them
~~~~~~~~~~~~~~~~~~~~~~~~
create a script that list the aliases.
when I run the script , this is a new process
I have jlo but not jlo2
~~~~~~~~~~~~~~~~
So this is exported for a process but not for a new shell
For this you need to setup your ENV variable :
ENV If this parameter is set, parameter substitution is
performed on the value to generate the path name of the
script to be executed when the shell is invoked (see
the "Invocation" subsection). This file is typically
used for alias and function definitions.
Regards,
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 09:36 PM
03-30-2004 09:36 PM
Re: setting aliases
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 10:51 PM
03-30-2004 10:51 PM
Re: setting aliases
alias set in .shrc are availabe in child shell where alias set at $prompt are not.
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 11:10 PM
03-30-2004 11:10 PM
Re: setting aliases
The . before the command makes sure the aliases are available in the current shell.
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2004 06:44 PM
03-31-2004 06:44 PM
Re: setting aliases
You need to add this line to your .profile :
export ENV=.alias.ksh
With this it will work.