Dave Horsfall <dave(a)horsfall.org> wrote:
On Thu, 14 Jul 2016, shawn wilson wrote:
I've always been curious though - what was
the reason behind
implementing /bin/[ ? IDK any shell where this isn't implemented - I
always assumed it's a POSIX compatibility stopgap older systems needed
to stay compliant with their shipped shell.
To implement:
[ blah ]
when it wasn't a built-in (there were few built-ins in those days).
I have no idea why it's still there... A Posix requirement, along with
really unsafe functions?
Consider
execlp("[", "-f", "/some/file", "]", NULL);
Then [ and test need to live in the filesystem.
Arnold