LINUX.ORG.RU

/bin/[


0

0

В системе был найден файл '/bin/[', который явно не наблюдается в других дистрах.

Что это может быть за бинарник? Поиск результата не дал.

★★★★★

root@nat:~# strace /bin/[
execve("/bin/[", ["/bin/["], [/* 28 vars */]) = 0
uname({sys="Linux", node="nat", ...})   = 0
brk(0)                                  = 0x804f000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=16610, ...}) = 0
mmap2(NULL, 16610, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f82000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0PS\1\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1421670, ...}) = 0
mmap2(NULL, 1236276, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb                                                                              7e54000
mmap2(0xb7f7c000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRI                                                                              TE, 3, 0x127) = 0xb7f7c000
mmap2(0xb7f80000, 7476, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOU                                                                              S, -1, 0) = 0xb7f80000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7                                                                              e53000
mprotect(0xb7f7c000, 4096, PROT_READ)   = 0
munmap(0xb7f82000, 16610)               = 0
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No suc                                                                              h file or directory)
brk(0)                                  = 0x804f000
brk(0x8070000)                          = 0x8070000
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2586, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7                                                                              f86000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2586
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0xb7f86000, 4096)                = 0
open("/usr/lib/locale/en_US/LC_IDENTIFICATION", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=378, ...}) = 0
mmap2(NULL, 378, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f86000
close(3)                                = 0
open("/usr/lib/locale/en_US/LC_MEASUREMENT", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=28, ...}) = 0
mmap2(NULL, 28, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f85000
close(3)                                = 0
open("/usr/lib/locale/en_US/LC_TELEPHONE", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=64, ...}) = 0
mmap2(NULL, 64, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f84000
close(3)                                = 0
open("/usr/lib/locale/en_US/LC_ADDRESS", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=160, ...}) = 0
mmap2(NULL, 160, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f83000
close(3)                                = 0
open("/usr/lib/locale/en_US/LC_NAME", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=82, ...}) = 0
mmap2(NULL, 82, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f82000
close(3)                                = 0
open("/usr/lib/locale/en_US/LC_PAPER", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=39, ...}) = 0
mmap2(NULL, 39, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7e52000
close(3)                                = 0
open("/usr/lib/locale/en_US/LC_MESSAGES", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
close(3)                                = 0
open("/usr/lib/locale/en_US/LC_MESSAGES/SYS_LC_MESSAGES", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=57, ...}) = 0
mmap2(NULL, 57, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7e51000
close(3)                                = 0
open("/usr/lib/locale/en_US/LC_MONETARY", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=291, ...}) = 0
mmap2(NULL, 291, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7e50000
close(3)                                = 0
open("/usr/lib/locale/en_US/LC_TIME", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2459, ...}) = 0
mmap2(NULL, 2459, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7e4f000
close(3)                                = 0
open("/usr/lib/locale/en_US/LC_NUMERIC", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=59, ...}) = 0
mmap2(NULL, 59, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7e4e000
close(3)                                = 0
open("/usr/lib/locale/en_US/LC_CTYPE", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=207720, ...}) = 0
mmap2(NULL, 207720, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7e1b000
close(3)                                = 0
open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (                                                                              No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No                                                                               such file or directory)
write(2, "/bin/[: ", 8/bin/[: )                 = 8
write(2, "missing `]\'\n", 12missing `]'
)          = 12
close(1)                                = 0
exit_group(2)                           = ?
Process 29722 detached

Igron ★★★★★
() автор топика

Это синоним test, чтоб в скриптах можно было писать:

if [ -f / ]; then echo "IMHO bred"; fi

anonymous
()

[root@localhost ~]# rpm -qf '/usr/bin/['
coreutils-6.9-3.fc7

[root@localhost ~]# ls -l '/usr/bin/['
-rwxr-xr-x 1 root root 28760 2007-06-13 20:06 /usr/bin/[


> явно не наблюдается в других дистрах. 

Наглая ложь.

birdie ★★★★★
()

Это аналог (иногда линк) на /usr/bin/test

В скриптах видел такое?
 if [ ... ]; then
   ^^^ эта скобка исполняемый файл, а не элемент синтаксиса, 
       потому и обязанa отделяться пробелами.

sdio ★★★★★
()
13 ноября 2007 г.
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.