[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bash script problem



On Thu, Aug 05, 2021 at 10:07:12AM +0200, tomas@tuxteam.de wrote:
> [1] Nowadays this is a little white lie: most shells have them
>    as builtins, but they are supposed to behave like regular
>    programs, for compat. There /is/ a /bin/test, but I can't
>    find a /bin/[ on my system anymore.

It's in /usr/bin on Debian.

unicorn:~$ type -a test [
test is a shell builtin
test is /usr/bin/test
[ is a shell builtin
[ is /usr/bin/[
unicorn:~$ ls -ld /usr/bin/[ /usr/bin/test
-rwxr-xr-x 1 root root 60224 Sep 24  2020 '/usr/bin/['
-rwxr-xr-x 1 root root 56128 Sep 24  2020  /usr/bin/test

I'm a bit surprised they're not the same program.  And also that they're
that large.  And that different in size from each other.

The external versions of test and [ need to exist for POSIX conformance,
and also so that you can -exec them from find(1) or other similar
programs.


Reply to: