![]() |
|
No such thing as a small change | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
In both zsh and bash the "command" shell builtin (and its cousin builtin) are helpers for bypassing shell functions or aliases. When you prefix something with it then the shell explicitly searches for an external thing to run rather than running any shell function or builtin of the same name. The usual usage is for something like having a shell function of the same name wrapping something (to say manipulate arguments passed) whenever in the function you want to actually call the "real" program (or in the case of builtin the shell's actual builtin command of the same name (e.g. you could write a cd shell fn which then actually calls builtin cd blahblah to make the shell change the cwd)). If you didn't then the shell would just recursively call the same function over and over.
At any rate two closing thoughts: zsh is just awesome and anyone not using it as their interactive or programming shell is missing out; and unless you've got some reaaaaaly wonky default shell environment you're dealing with there's probably not much reason to prefix something you're calling from perl (or anything else "external") with (The command in /usr/bin on OSX is actually a bash script actually which calls builtin which is just weird . . .) Edit: made advice about "command" being unneeded more explicit.
The cake is a lie. In reply to Re^2: Can't exec "command": No such file or directory error
by Fletch
|
|