I am used to using "which stuff" do find the file that will be called when I use "stuff". I was quite surprised to see "which prompt" respond with
prompt () {
local prompt_opts
set_prompt "$@"
(( $#prompt_opts )) && setopt noprompt{bang,cr,percent,subst} "prompt${^prompt_opts[@]}"
true
}
on my Archlinux system. Where does this come from, and how do I make the prompt command avaliable inside the chroot environment I am currently building? (I just copied the other commands into it... that does not work here =) )
Edit: I am using zsh as my shell, maybe that changes something.
type
rather thanwhich
. I'm guessing ArchLinux redefineswhich
somehow. I wouldn't know. But I guess the OP's real problem is determining which file defines theprompt
function. – Joseph R. Nov 07 '13 at 22:09which
show a function either,type
makes more sense. – slm Nov 07 '13 at 22:14grep -R "prompt ()" /etc /usr
later I found the function definitions in/usr/share/zsh/functions/
. Thanks again =) – Jens Nov 07 '13 at 22:27which
is a builtin and can be used without compunction. – Gilles 'SO- stop being evil' Nov 07 '13 at 22:43type
-like behavior ofwhich
is due to thezsh
implementation rather than ArchLinux, right? – Joseph R. Nov 07 '13 at 22:49