Op 21-03-17 om 18:08 schreef Greg Wooledge: > A builtin is always used by preference over an external command of the > same name. You don't need to specify "builtin jobs" to be sure you're > using the builtin. Just use "jobs". > > The only time you need to use the "builtin" command is when you're > defining a function by the same name, and you want bash to use its > builtin instead of your function.
You may also need to use it if you're writing a function or script used by another program you don't control, or in another user's interactive shell environment. In that case you have no way to be sure whether 'jobs' might already be used as an alias or function name. A workaround for the original poster's problem could be: (unset -f jobs; unalias jobs; eval 'jobs -l') | wc The 'eval' is to stop the alias from being expanded at parse time before you have a chance to unalias it. This should be about as robust as running 'builtin jobs -l', except it still doesn't check whether the builtin might have been disabled. - M.