Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Oct 2017 14:44:13 -0700
From:      Carl Johnson <carlj@peak.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: A request to segregate man pages for shell built-ins
Message-ID:  <86po99oa8i.fsf@elm.localnet>
In-Reply-To: <20171026214620.bf8fcbf2.freebsd@edvax.de> (Polytropon's message of "Thu, 26 Oct 2017 21:46:20 %2B0200")
References:  <mailman.113.1509019202.90583.freebsd-questions@freebsd.org> <20171027021115.A40402@sola.nimnet.asn.au> <20171026214620.bf8fcbf2.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Polytropon <freebsd@edvax.de> writes:

>>  > Keep in mind some shells also offer a builtin replacement for
>>  > an existing binary. A good example is echo where a binary exists,
>>  > but the C Shell has its own internal echo, while BASH uses the
>>  > binary one:
>>  > 
>>  > 	% which echo
>>  > 	echo: shell built-in command.
>>  > 
>>  > 	$ which echo
>>  > 	/bin/echo
>> 
>> Again, despite that, echo _is_ builtin to sh(1) - and has more options.
>
> That is correct (even though sh's "which echo" reports the binary);
> sh's echo supports escape sequences using the -e option, while the
> binary doesn't.

'Which' is an external for sh so it can't show builtin commands.  Sh has
the builtin 'type' command which is the equivalent of 'which' for csh.

-- 
Carl Johnson		carlj@peak.org




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86po99oa8i.fsf>