Hi,
I'd like to use exported aliases in the ksh.
What is wrong in my example:
$> alias -x ll='ls -l'
$> alias -x ## I see ll alias in the output
$> ksh
$> ll
ksh: ll: not found
Hi Vadim,
all aliases that you want to use must be defined in your environment (.profile for example) because they are living in shell and subshells, but not in parents shell.
Regards Boris.
Exported aliases don't get passed when you invoke a new shell. You can use them in a script though. If you had an executable script called with just...
[tt]
ll
[/tt]
...in it, then you could run the script and the [tt]ll[/tt] would work as long as it was aliased before the script was run.
From what I understand, the older version of ksh (11/16/88) supported a -x option that exported alias definitions to scripts run by ksh. It appears that the newer versions of the shell do not support this option.
If you only want the alias to appear in your login shell, place the alias definition in .profile.
If you want the alias to appear in each of your subshells, add this line to your .profile:
export ENV=$HOME/.kshrc
...and then add the alias definition to the .kshrc file.
Biker
Systems/Network Administrator
LiveFire Labs - Online UNIX and Linux Training with Hands-on Internet Lab
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.