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.
typerather thanwhich. I'm guessing ArchLinux redefineswhichsomehow. I wouldn't know. But I guess the OP's real problem is determining which file defines thepromptfunction. – Joseph R. Nov 07 '13 at 22:09whichshow a function either,typemakes more sense. – slm Nov 07 '13 at 22:14grep -R "prompt ()" /etc /usrlater I found the function definitions in/usr/share/zsh/functions/. Thanks again =) – Jens Nov 07 '13 at 22:27whichis a builtin and can be used without compunction. – Gilles 'SO- stop being evil' Nov 07 '13 at 22:43type-like behavior ofwhichis due to thezshimplementation rather than ArchLinux, right? – Joseph R. Nov 07 '13 at 22:49