On Aug 27 12:54:27, Paul de Weerd wrote:
> On Fri, Aug 27, 2010 at 12:31:34PM +0200, Jan Stary wrote:
> | On my 4.8-current, the manpage of ksh says
> |
> | hash [-r] [name ...]
> |
> | Without arguments, any hashed executable command pathnames
> | are listed. The -r option causes all hashed commands to
> | be removed from the hash table. Each name is searched as
> | if it were a command name and added to the hash table if
> | it is an executable command.
>
> That same manpage says :
>
> The following command aliases are defined automatically by the shell:
>
> autoload='typeset -fu'
> functions='typeset -f'
> hash='alias -t'
>
> | However,
> |
> | $ hash
> | ksh: hash: not found
> |
> | Am I missing something obvious?
>
> Did you unalias stuff in your environment ?
Yes I did:
$ cat ~/.shrc
# shell settings
umask 022
set -o emacs
# environment
export BROWSER=lynx
export CVS_RSH=ssh
export HISTSIZE=1000
export HISTFILE=~/.history
export LESS="-g -i -M"
export PAGER=less
export PS1="\...@\h:\W\$ "
export XENVIRONMENT=~/.Xresources
export LC_ALL=C
# aliases
unalias -a
alias ls='ls -p'
alias ll='ls -lAp'
alias mtr='mtr -t'
(In fact, I just converted to ksh from bash,
where lot of automatic shit needed to be got rid of.
The automatic aliases of ksh are pretty useful OTOH.)
Anyway, 'hash' is just an alias, as is e.g. 'suspend'.
Why is it that 'hash' is described as a separate command
in the 'Command execution' section, but 'suspend' is not?
> Anyway, easy solution is
> to re-add the alias. It works for me (on -current, and since I've been
> using OpenBSD):
>
> [we...@doom] $ type hash
> hash is an alias for 'alias -t'
> [we...@doom] $ hash
> [we...@doom] $
Now I appreciate the nonintended insider point
of 'type' being just an alias for 'whence -v' :-)
Thank you
Jan