You are not logged in.

#1 2019-10-03 15:18:50

whaler
Member
From: Oslo, Norway
Registered: 2008-03-25
Posts: 324

[Solved] Curious filename "["

Looking around in my system, I noticed there was a (binary) file "[" in /usr/bin; i.e. /usr/bin/[
In the file there are references to gnu.org and coreutils.
I moved the file away from /usr/bin and reinstalled "base" and the file was recreated.

I assume this is a bug in "base", but who knows these days.
I wonder what the intended name of the file is and which function(s) I may be missing.

Last edited by whaler (2019-10-03 18:02:49)

Offline

#2 2019-10-03 15:35:39

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,372

Re: [Solved] Curious filename "["

No this is an actual and necessary file it's a program called test and utilized for conditional checking of expressions with shells that do not have a built-in: https://en.wikipedia.org/wiki/Test_(Unix) https://www.shellscript.sh/test.html

Last edited by V1del (2019-10-03 15:36:47)

Offline

#3 2019-10-03 15:36:57

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,701

Re: [Solved] Curious filename "["

It belongs.  I think it is used with the Borne shell.
For Bash, it is a built in command.

ewaller@odin/home/ewaller % file /usr/bin/\[
/usr/bin/[: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=02a04641217f2da7b459b45f83a7c0c184f52b82, stripped
ewaller@odin/home/ewaller % type \[
[ is a shell builtin
ewaller@odin/home/ewaller %

Edit:  To slow smile

Last edited by ewaller (2019-10-03 15:37:22)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#4 2019-10-03 18:01:55

whaler
Member
From: Oslo, Norway
Registered: 2008-03-25
Posts: 324

Re: [Solved] Curious filename "["

Assumptions, assumptions...

OK, thanks for the replies. I feel better wink

Offline

Board footer

Powered by FluxBB