У меня большой файл, и я с помощью grep ищу нужную мне строку . Есть необходимость использовать обход реестра.
Итак. Я использую PHP-код:
Код: Выделить всё
$text = "тест";
$result_vul = trim(shell_exec('grep --ignore-case "'.$text.'" file.txt'));
echo $result_vul;
Код: Выделить всё
ТЕСТ 123 Тест 456Код: Выделить всё
webs@user:~/web$ cat test.txt
ТЕСТ 123
Тест 456
webs@user:~/web$ grep -i "тест" test.txt
ТЕСТ 123
Тест 456
Код: Выделить всё
webs@user:~/web$ grep --version
grep (GNU grep) 3.8
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and others; see
.
Подробнее здесь: https://stackoverflow.com/questions/786 ... ep-command
Мобильная версия